NFC: digital: Delete an error message for memory allocation failure
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 22 May 2017 12:24:24 +0000 (14:24 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 22 Jun 2017 22:14:12 +0000 (00:14 +0200)
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 <elfring@users.sourceforge.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/digital_core.c

index 321514636da173c8f411c393f9543521b2148ee6..de6dd37d04c7065b9eb9f5186f735136048be335 100644 (file)
@@ -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;