From patchwork Mon May 22 13:00:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9740229 X-Patchwork-Delegate: sameo@linux.intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A016D60392 for ; Mon, 22 May 2017 13:00:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94AE028703 for ; Mon, 22 May 2017 13:00:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8976628705; Mon, 22 May 2017 13:00:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1419C28703 for ; Mon, 22 May 2017 13:00:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933286AbdEVNAk (ORCPT ); Mon, 22 May 2017 09:00:40 -0400 Received: from mout.web.de ([212.227.15.4]:53260 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753402AbdEVNAi (ORCPT ); Mon, 22 May 2017 09:00:38 -0400 Received: from [192.168.1.2] ([78.49.33.162]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M8L3a-1e7FNx2VIA-00vyoG; Mon, 22 May 2017 15:00:19 +0200 Subject: [PATCH 2/2] NFC: digital: Delete an error message for a failed memory allocation in digital_in_send() From: SF Markus Elfring To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Samuel Ortiz , Thierry Escande Cc: LKML , kernel-janitors@vger.kernel.org References: <7e27a76c-de7a-22ec-cf8a-31aee2000e29@users.sourceforge.net> Message-ID: <94b99b09-8f6f-3532-0738-b2edba96dd26@users.sourceforge.net> Date: Mon, 22 May 2017 15:00:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <7e27a76c-de7a-22ec-cf8a-31aee2000e29@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:1xEM/L30b6Vz2p8Rx3vwrV4ag1cwxvvSxEy8t6EOfRV/Vd3xeeJ V8ae+trCbkpJkDG/qeH7sZaADVg2SXRpBXLIlhVTbMNP2iyTkotuSkE8gc/8QbOV2UzVqQ1 tHNXnDey59inlMitQJD3bIAGxamTrWXe4/zofOPxW0cvF4xu6Yq1T5Y6aRiQc/YNDDSZn6g bCwVIgHaEyyw+zDjz/9Sw== X-UI-Out-Filterresults: notjunk:1; V01:K0:/EJWjvpEtKc=:Lo848LVWlvnVve01BTFIyv UnpXbWux5c8tMuOloleJ1+Wy7d9fUuwe222//QpRyreWDGfQn9sK+Tl/61vV7FkSsAYE0xt0t dj6bS3A+hET93CFChdYjOYIelb+QYY5QLneTrZAGfQLp2dAtlxXKoTUH1m5NWT5926vjM68kA 7JVJm+vzku0lBfOnzMQhkUUrmQlM2SmRsz26CGFrqZX4oGJYAaUBIlYZHg57ztqdedfOUw8P6 7Ek020rLtzpoV6UZjZw4cMbCehh7WUs9/QojWCyK0w1qrtP++Nlt1AQT4yp2S8OhesJhi0/5N NgeeH5IStxRJjGkfXB0kDI9RAyejDJTYtk0oxTNIFlgh9yaBc0HjhcgV29YQKaXd8GiLPp0Lt JecjOKtWYQifvh6/5p94Qor0cZOkpMlnrRcC3XN8JRgetOVsCyuKnHJ4wwXmCcriuXvZEuFhA I1DItvFPoIzQqeIEdLlvPe0AIGRCqWBnT/X/U7rqakC4GPhjUoHBnUwlG2Q7m6d36qZdxwB7R D+DySjJcs0aVM3GQSdBEsRlPJZBSb0uvdrLKbdcRYqta3/vW4lQdrB+7zGjWOea1xvDQ8V9rb nymGqC9WnjTCqLrTWbVEBMmolDsjDgCFxkHjftC87HsST655HDKGzA422n2fjle+eLLs5+eav f7oMKRFbR56kVASe8xtUZnLE3Xcktvc8cv1VE9TAw0muTchANVt5DKGiJQLKLQBB/l3gEJh7l qN6brArnMlQDkXTgArjtdH1Q+1si9izgCZUEzb+N4tFl6ho1R1jRw7a82P+SsPhVLeF4RK2L5 Y5tTVSx Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 22 May 2017 14:24:24 +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 --- net/nfc/digital_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c index 3baf91f3ef80..8e02a3e1b319 100644 --- a/net/nfc/digital_core.c +++ b/net/nfc/digital_core.c @@ -710,7 +710,5 @@ static int digital_in_send(struct nfc_dev *nfc_dev, struct nfc_target *target, - 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;