Messages in this thread Patch in this message | | | Subject | [PATCH 3/4] uwb/i1480/dfu/mac: Delete an error message for a failed memory allocation in fw_hdrs_load() | From | SF Markus Elfring <> | Date | Tue, 5 Dec 2017 21:29:13 +0100 |
| |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 5 Dec 2017 21:00:03 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/uwb/i1480/dfu/mac.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/uwb/i1480/dfu/mac.c b/drivers/uwb/i1480/dfu/mac.c index 6ec14f5fcde4..ee71973f47ad 100644 --- a/drivers/uwb/i1480/dfu/mac.c +++ b/drivers/uwb/i1480/dfu/mac.c @@ -123,11 +123,9 @@ int fw_hdrs_load(struct i1480 *i1480, struct fw_hdr **phdr, data_itr = data; data_top = (u32 *) (_data + data_size); while (data_itr < data_top) { - result = -ENOMEM; hdr = kmalloc(sizeof(*hdr), GFP_KERNEL); if (hdr == NULL) { - dev_err(i1480->dev, "Cannot allocate fw header " - "for chunk #%u\n", hdr_cnt); + result = -ENOMEM; goto error_alloc; } result = fw_hdr_load(i1480, hdr, hdr_cnt, -- 2.15.1
| |