Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751368AbdH0TZk (ORCPT ); Sun, 27 Aug 2017 15:25:40 -0400 Received: from mout.web.de ([212.227.17.12]:52966 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751255AbdH0TZi (ORCPT ); Sun, 27 Aug 2017 15:25:38 -0400 To: netdev@vger.kernel.org, Evgeniy Polyakov Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] connector: Delete an error message for a failed memory allocation in cn_queue_alloc_callback_entry() Message-ID: <7b206228-b3e9-5cb9-873c-75b5d8aae23b@users.sourceforge.net> Date: Sun, 27 Aug 2017 21:25:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:V7NO/4BlUYM28sWIciI/9hJX/Xn71Rr2GgrQVSGXRznZsetHx+G JQgWl+CpEJcXqpRDa2sR6NzptKyPBeN41QNmhUEdl4U32NPqB6ztPfjWwXsee5GkrJjutP4 b/Wf3yAnayw6taPe/pYSxWm+1MvZ+arJ+jQiU3FRzPyvPr4Qaw3WojxmfmXDTC6l514edvI 8adMcxKsqfRc90mSruMLw== X-UI-Out-Filterresults: notjunk:1;V01:K0:/dB0Bn+z90o=:f46hdv7yAhNytj1wKe+YN2 3n1vD00xwfBFvZ3B0f9hrKHO1AQm8TXxtgKRy0lRdaudLl7t6qNjHGEGCVsKYvYERlcSIilCs shgHDExJkEhhznEeJ7ZBgUXXIdJZys6IW1hFiMSin9UjsoycHnppzIjU4akJhZebZGpWiFvUA nySdbq5mgmBE53RAfV+nNZrGaJKDvRlcx+cmkMFrRCtg1TBo7mpj2jQBXT16ByqxJ2ffXi08p kdieKPAm0gazxQAXSdqvYleYe0YFDx4C6v4g3O2P1s0GZmu4ReBJLubH8ypYnbkQDcZQdw/yh VqY0WyljuzhY2AqWAMDt3m/dQTG17WTxft/cPrRTIs38Cbx94rYzY1TKnUJ3kvK9+9RZci1Tz mn/qfgWZ6K7bzAX2pBExewk2Vqbe6RuB4z3vT+fc0dajfx/V/8K03fxDQmbbX4vS/AUt7VRFx 1lDvdQWqzA3G4xUfRIqVqChrN9MgbwVkgoq2qJhDKymPSbK13CWwUzTsijXPOrwNqQPLqzRrb Oly8Ksx9qR5KXSXemxxMthok37g7k6b0nKgwPH8W+dFOFCTP2iFfJ/f0JbKqIaz+tKJj4zsTk MVPwzZFsADBOMG0EUY6X6kQ2dG+sK1KRZyAa1UDQkbwbMYn5L1q+C2Fvxk7BE6RVrnfcLRkWI vfC0C4Kv8kx0arT3tLB9I0RsO0WB+HCWnW4rKoor0wH3bsSfR+sU6B0MWIr3hSDYlYe/zgCgB kgHnEZkNTsxDXtzwWUFmYMeOX1kbfRvTIrSAjd2j3dftZb1DWC8RY53z0gVVmLHBa3VBiaeuh V2Zr/h2/v/ApFXx3gCoZ/jQ+3tcfrt/OdPsL1LM7e/5yuM8lV0= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 877 Lines: 30 From: Markus Elfring Date: Sun, 27 Aug 2017 21:18:37 +0200 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 --- drivers/connector/cn_queue.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c index 1f8bf054d11c..e4f31d679f02 100644 --- a/drivers/connector/cn_queue.c +++ b/drivers/connector/cn_queue.c @@ -40,10 +40,8 @@ cn_queue_alloc_callback_entry(struct cn_queue_dev *dev, const char *name, struct cn_callback_entry *cbq; cbq = kzalloc(sizeof(*cbq), GFP_KERNEL); - if (!cbq) { - pr_err("Failed to create new callback queue.\n"); + if (!cbq) return NULL; - } atomic_set(&cbq->refcnt, 1); -- 2.14.1