From patchwork Wed Aug 30 20:21:13 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: 9930723 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 159A060383 for ; Wed, 30 Aug 2017 20:21:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0945728479 for ; Wed, 30 Aug 2017 20:21:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F25D328790; Wed, 30 Aug 2017 20:21:34 +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 935E12855D for ; Wed, 30 Aug 2017 20:21:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbdH3UVU (ORCPT ); Wed, 30 Aug 2017 16:21:20 -0400 Received: from mout.web.de ([212.227.17.12]:52450 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750758AbdH3UVT (ORCPT ); Wed, 30 Aug 2017 16:21:19 -0400 Received: from [192.168.1.2] ([77.182.113.36]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LnjBT-1dIjg50Gch-00hu4J; Wed, 30 Aug 2017 22:21:14 +0200 Subject: [PATCH 1/4] [media] ds3000: Delete an error message for a failed memory allocation in two functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <3f061ac7-4738-ec12-3f4b-dca8c2b6eba5@users.sourceforge.net> Date: Wed, 30 Aug 2017 22:21:13 +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: Content-Language: en-GB X-Provags-ID: V03:K0:A+QJh/3myrCIyB7Fy9HvBmUXjC0K5tFRgV/+MdRIUqk9e0O54bU HzbsgvUMEQ4zqx07+jPLMYCHTWX/16vfEikRzzMp66FD0MDLbA+Hcvqj2v7jY/xi01RQn/B DK5GojiFJsE8+WxoG4Gj9DlSKtHy/0pJLbv9+TNA1amsw8oI+Q7C4Z7QOCJMmtJi/mQJt43 LC8qhK7UjLxeuTtkcMT3A== X-UI-Out-Filterresults: notjunk:1; V01:K0:nz12jfjBKV4=:XyvWGwVTU4Yh5eFBXxNGu1 AvIxDgsGfx/G2wl7FuSUW27mBUUQUUjEoKYO8xYw3ESS17QsawWQbH5cYJwtl9UR7gHxn+y2G dIcmkcKdALeF7qiF7P7kxCLuvUA3uBotJ+jfPFYYJrkUPqrAHkLOEuSU7Yfw+Uhi3cC10XaSC OADiBwXDanYqegN677iPHuLH/TmKUTJFUZLxvTnHOTpBNPysNSp5YEwo2a4+V2Rkbo3ompK49 44RS1dNqYKcgHihg2h45Z7m8kjGiYDbSSfP4z0fOSyTQydOpTrOXrnQvX+X7Y0W0wVQiOatxK G6vlPdPGc1ROz0OqhtxW7G/O2YZ8BQCM3EQaKFkFgc6V5sFq78ulqQgtRVuXCwELFpwaph29T bSXEROHdjU4gOZ4Ph+vFqZhtHFNdv0rZGCgXS8QwYUDu+jStLV5GSRwt+9QIsg2NUbQyu2jhJ uGZYLxLs5BEd2MOginqgJS+0w9q9i6gGaTF3wY+FcGHWgARY1WxjkT7h3nroPO/kWC+QmvEQw s9/Lh4zmjUO92lRoK3VVWC4rHcWWj4XEM8aVyoTBWV5HOHSCxc8b6L37DaWFgG2WFJlEFOF58 qCyUWFhAVMJkIv5K8v49pPUuEyqpaKcFiepx9cqxcvScKzjqkrHHyX9GKPt9wNLWYQCDgL/vY ugjxbHcYdStGFnKqlafJj+m1K6/ihqWzfxUU3Q8nZtvjLR3BdTMTeMm4oZmVQrgXHBHlB3Q/4 h9FwzJN0kxX9L033QTF3c/zGMXXKCuKNvA3UJFLMSMQOaRt7nwAzL/+vcqRp01YYLODxyNjuS zJ0utvKGglzqIPLZEaJCLatS8Ns2ZOp4fw/owcp+RGngNofd/Q= 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: Wed, 30 Aug 2017 21:41:28 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/ds3000.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index 0b17a45c5640..c2959a9695a7 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c @@ -280,7 +280,5 @@ static int ds3000_writeFW(struct ds3000_state *state, int reg, - if (buf == NULL) { - printk(KERN_ERR "Unable to kmalloc\n"); + if (!buf) return -ENOMEM; - } *(buf) = reg; @@ -845,7 +843,5 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, - if (state == NULL) { - printk(KERN_ERR "Unable to kmalloc\n"); + if (!state) goto error2; - } state->config = config; state->i2c = i2c;