From: Markus Elfring Date: Mon, 22 May 2017 12:24:24 +0000 (+0200) Subject: NFC: digital: Delete an error message for memory allocation failure X-Git-Tag: v4.13-rc1~157^2~42^2~9 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=dcfca27faf6d19d2af530cfccee2fcdbcd836a2c;p=linux.git NFC: digital: Delete an error message for memory allocation failure Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring Signed-off-by: Samuel Ortiz --- diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c index 321514636da1..de6dd37d04c7 100644 --- a/net/nfc/digital_core.c +++ b/net/nfc/digital_core.c @@ -707,10 +707,8 @@ static int digital_in_send(struct nfc_dev *nfc_dev, struct nfc_target *target, int rc; data_exch = kzalloc(sizeof(*data_exch), GFP_KERNEL); - if (!data_exch) { - pr_err("Failed to allocate data_exch struct\n"); + if (!data_exch) return -ENOMEM; - } data_exch->cb = cb; data_exch->cb_context = cb_context;