summaryrefslogtreecommitdiffstats
path: root/common/state
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2017-09-25 12:02:35 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-09-26 08:51:30 +0200
commit25e67cbb2fce8690bcde07598ad4998aad475f13 (patch)
tree54022a807486509d258475d8cbe702cdb1dfd78e /common/state
parent347ab857903a8e613052a28540abdcf78edb2f1b (diff)
downloadbarebox-25e67cbb2fce8690bcde07598ad4998aad475f13.tar.gz
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/state')
-rw-r--r--common/state/backend_bucket_circular.c2
-rw-r--r--common/state/backend_format_dtb.c2
-rw-r--r--common/state/backend_format_raw.c4
3 files changed, 0 insertions, 8 deletions
diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c
index f83bd67..2324903 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 4c9d2ee..48f30db 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 2ba97e0..4369f76 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);