diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2017-09-25 12:02:35 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-26 08:51:30 +0200 |
commit | 25e67cbb2fce8690bcde07598ad4998aad475f13 (patch) | |
tree | 54022a807486509d258475d8cbe702cdb1dfd78e /common | |
parent | 347ab857903a8e613052a28540abdcf78edb2f1b (diff) | |
download | barebox-25e67cbb2fce8690bcde07598ad4998aad475f13.tar.gz barebox-25e67cbb2fce8690bcde07598ad4998aad475f13.tar.xz |
remove checks for xzalloc() returning NULL
xzalloc() either returns memory or panics, so checking for NULL is useless.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/state/backend_bucket_circular.c | 2 | ||||
-rw-r--r-- | common/state/backend_format_dtb.c | 2 | ||||
-rw-r--r-- | common/state/backend_format_raw.c | 4 |
3 files changed, 0 insertions, 8 deletions
diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c index f83bd679d7..2324903255 100644 --- a/common/state/backend_bucket_circular.c +++ b/common/state/backend_bucket_circular.c @@ -310,8 +310,6 @@ static int state_backend_bucket_circular_write(struct state_backend_storage_buck * random changes */ write_buf = xzalloc(written_length); - if (!write_buf) - return -ENOMEM; memcpy(write_buf, buf, len); meta = (struct state_backend_storage_bucket_circular_meta *) diff --git a/common/state/backend_format_dtb.c b/common/state/backend_format_dtb.c index 4c9d2eefc7..48f30db1f5 100644 --- a/common/state/backend_format_dtb.c +++ b/common/state/backend_format_dtb.c @@ -136,8 +136,6 @@ int backend_format_dtb_create(struct state_backend_format **format, struct state_backend_format_dtb *dtb; dtb = xzalloc(sizeof(*dtb)); - if (!dtb) - return -ENOMEM; dtb->dev = dev; dtb->format.pack = state_backend_format_dtb_pack; diff --git a/common/state/backend_format_raw.c b/common/state/backend_format_raw.c index 2ba97e08a0..4369f76e37 100644 --- a/common/state/backend_format_raw.c +++ b/common/state/backend_format_raw.c @@ -222,8 +222,6 @@ static int backend_format_raw_pack(struct state_backend_format *format, size_full = size_data + sizeof(*header) + backend_raw->digest_length; buf = xzalloc(size_full); - if (!buf) - return -ENOMEM; header = buf; data = buf + sizeof(*header); @@ -308,8 +306,6 @@ int backend_format_raw_create(struct state_backend_format **format, int ret; raw = xzalloc(sizeof(*raw)); - if (!raw) - return -ENOMEM; raw->dev = dev; ret = backend_format_raw_init_digest(raw, node, secret_name); |