From patchwork Sat Sep 16 20:08:33 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: 9954463 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 AC26C601C0 for ; Sat, 16 Sep 2017 20:09:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BF8D28D06 for ; Sat, 16 Sep 2017 20:09:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C43A28C9F; Sat, 16 Sep 2017 20:09:23 +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 281C128C8D for ; Sat, 16 Sep 2017 20:09:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751370AbdIPUIk (ORCPT ); Sat, 16 Sep 2017 16:08:40 -0400 Received: from mout.web.de ([212.227.15.4]:49514 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbdIPUIj (ORCPT ); Sat, 16 Sep 2017 16:08:39 -0400 Received: from [192.168.1.2] ([78.48.47.134]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lheu9-1d6YS32RDl-00mv9v; Sat, 16 Sep 2017 22:08:34 +0200 Subject: [PATCH 1/2] [media] tuners: Delete an error message for a failed memory allocation in m88rs6000t_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <278b14e0-f717-7471-6dc3-45dc98d64443@users.sourceforge.net> Message-ID: Date: Sat, 16 Sep 2017 22:08:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <278b14e0-f717-7471-6dc3-45dc98d64443@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:emVxLWAcGmlJZxNSUMOK1UZpT2Khgm9bBrF8YDUTNxHkAh57ET0 AX0Vxdup0zAFBEV8gUF1bu9CWBPIYuXsm2kAWOdlazKzCCientHXJwDwscwe/FcHR2KOJRM k9Jj+pYQQ7CEgxIpIXGTeABJED0V3FV0OU69Gwmz8ZM+1NZS+Cu4L59S4Z4MihzS8Gd9hSD mTWwBN+3EQm9UTiH+6vIQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:dTIFs7YqSe0=:LGmdMiIXs6pFI4OcuJDlMm 3PYSGGp0qLXpo143UHU15ORa+/AN/Wu+S0GS8MkCSxaA4LHoxAuIJjcWnVZ8t2jCUTOtnZLah 8GHK18NEpP/OPiKjer9Vdrj1RyErGZJgBHaWLJUCYBUaxzw+t43DRiwhT+Fv+sKhIM9E3Chnj I1htkIo8jGrL8DxRSBA3ryC0hWQzyHGwYFpME8Uj3ZtJez/11UOOOXk3WOAZTJw3zNqQ62hmO /Qk49Mjiqdpid9HHvsALGjsWMHMC+7KW+bROZKm40VIntcRRusRy2kk/eSPsA28sMezBY4xfg 6N1ihFGKcDJS5LUqdi1L+bGJheIMJ66qdkTL1AN7GufkdvthWbveI1VMAkr1/NwJPf6aKrFqd M1/w98gqhD/elDDQZ5JegO2A6h8u7B+gr2E8m92doBbe59PKMQOQXvwyy+fzHLCUBqU9vKYee qfpRggdrn5YTkPmN5Idw4H8uKFRd8gIgKSJNDaBKofmwNZ8lzxXoPtYg6Xq9UGBbPA8dx1KhV 7HdrntNZYI/845a2f6IvqIPYMUtVltvbsOFjCmemwJDh8U3W0G9jseYHjKWtKbpLJkmdhmFjC KZa5ht+KMXakF+YFGzgdnhtGONnrCjBB8LbhbkN14/IsrEuPouZGX9skfmjZtDkO1EYBK4JO/ uibUgz7uqbIeUJEH8oSUTdjcPbIdq4a4Vq0cXe3OPiYjq6JGP+90gc9Ija7mIuQaJLy0tZvS5 wDG3uDaDBuhQuyYepT2KRwaXmp+DKwFegy+MXclicgLYIjlZSgCE0HAUkEKYuwwokw6Wd28/I YZFUUAipNdn/JtHXIK0K8twEId/XwJzA5JA7xa7WvnL/6iJOL8= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 16 Sep 2017 21:24:27 +0200 * Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. * Add a jump target so that the function "kfree" will be always called with a non-null pointer. Signed-off-by: Markus Elfring --- drivers/media/tuners/m88rs6000t.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/tuners/m88rs6000t.c b/drivers/media/tuners/m88rs6000t.c index 9f3e0fd4cad9..d89793a05862 100644 --- a/drivers/media/tuners/m88rs6000t.c +++ b/drivers/media/tuners/m88rs6000t.c @@ -626,6 +626,5 @@ static int m88rs6000t_probe(struct i2c_client *client, if (!dev) { ret = -ENOMEM; - dev_err(&client->dev, "kzalloc() failed\n"); - goto err; + goto report_failure; } @@ -701,8 +700,9 @@ static int m88rs6000t_probe(struct i2c_client *client, i2c_set_clientdata(client, dev); return 0; err: - dev_dbg(&client->dev, "failed=%d\n", ret); kfree(dev); +report_failure: + dev_dbg(&client->dev, "failed=%d\n", ret); return ret; }