From patchwork Fri Nov 24 20:49:36 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: 10074571 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 D936B60383 for ; Fri, 24 Nov 2017 20:50:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C97B72A134 for ; Fri, 24 Nov 2017 20:50:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE7252A224; Fri, 24 Nov 2017 20:50:25 +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=ham 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 63BA22A134 for ; Fri, 24 Nov 2017 20:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753709AbdKXUuY (ORCPT ); Fri, 24 Nov 2017 15:50:24 -0500 Received: from mout.web.de ([212.227.15.4]:62715 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753584AbdKXUuX (ORCPT ); Fri, 24 Nov 2017 15:50:23 -0500 Received: from [192.168.1.3] ([78.53.250.25]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M0QlZ-1f8FI316mT-00ubOr; Fri, 24 Nov 2017 21:50:14 +0100 Subject: [PATCH 1/4] video: udlfb: Delete an error message for a failed memory allocation in two functions From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Bernie Thompson Cc: LKML , kernel-janitors@vger.kernel.org References: <6fb11bb4-2c1d-a939-087b-de31c42328b9@users.sourceforge.net> Message-ID: <6ae3ae6d-acd2-38d2-0350-4a9b833489ec@users.sourceforge.net> Date: Fri, 24 Nov 2017 21:49:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <6fb11bb4-2c1d-a939-087b-de31c42328b9@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:+JVFABwhEAUV5hgqfVFrpSpufdF7myOjtUuDlfCeYqcXJh08wX2 xPcLHYV0tKpLt87jRP5STFQSuZaJ6wXYGrDWUY3wYNP2UeK7maizkA4qJ6MAn34BGkx0j1A uWdc7bFd7wqPuWP9VcJBAMV7cBZMkEyn1xGwKg5ybYeIR5KZIK3QF2jYMWslaoDobnHA0Em +OfUVlAxq9cdgrN2pSbUA== X-UI-Out-Filterresults: notjunk:1; V01:K0:jq5/lubxF98=:uW6V3SQCPgtqI5ijACssRW 2RYNmNbaPjAU63JdsDZK87rl9GQ/5XSANNQ8ugdjPOG7tTUSot3AzUNFBTjUluXCEIgUfAHex kAoExNGRHNzUmzODKw6AqU9iGCLv43B2Q57/VgfdCegENB8ETX1NQC6ONOj7tziuuZ92K1FGa hba1u46H2b87GWmelDX5PAFc19QKy4M3STeJEHqMdAqBAYPNPmNicY545cf5XBTnjVG8kO63B cm8pTxt3W383yHsCXnAb94xB0LeGwYh+Rb0VvP3eiXtcFTE7BR3ATZtHNFNV9t7f/X+KuQtyO RlU25xEA9+lr2XURUYErzs5Wg4QWFwa0HhEHn6TGdYE39UrWA3d+pCRu5/QmXOx0dKLbnO4sF jTT+LAp6RpZjtgk4CmTeHNKCs+Ozd014xxK6wg3nXvl68uyrq2pHmto0FeTHOVDTfA4chB0YC ZjxgEYug85EKGe737uB77ZSOMSxDjA9gPmv7O0EuaA7F8nxhUWJ0CM2yrM4QJ4jiwWXTBoRU8 qDRN9dLH1czo7Ek70pLRb3/BnwJ+dlh+jxovlp93COXLnB5OdNYpNIMVSAfIaI3EXC5xC9kQ+ uOO0LBNCuOXCzYXbxu0ZUWl6Djlc0sHvw3Svsly4HEdUU4Y3kFbrUmUdouW853a8WUuH8a2a4 eHJw1ELvM1c7LqwcAHBqKtIy8aiS+qHfI4q35/r/2pP3IZL4u06sbwVIIcHcsIYJja+7fudaQ wx3kAf9scb+CLS/es6NSBhoQR+mF0x6mdm84B3Y5Wopsd94MCjpy18Vb3k8KGQaVtckLm/POa 17nlxUUawrP7IZRqMvtwuW5MM9Cdj7bhyCGxsRTDc3FlD1wccepL9QJ8gturRPTnhi1SnQt Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 24 Nov 2017 21:12:54 +0100 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/video/fbdev/udlfb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index d44f14242016..77633c58bb9b 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1175,10 +1175,8 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) * Alloc system memory for virtual framebuffer */ new_fb = vmalloc(new_len); - if (!new_fb) { - pr_err("Virtual framebuffer alloc failed\n"); + if (!new_fb) goto error; - } if (info->screen_base) { memcpy(new_fb, old_fb, old_len); @@ -1599,10 +1597,8 @@ static int dlfb_usb_probe(struct usb_interface *interface, usbdev = interface_to_usbdev(interface); dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (dev == NULL) { - dev_err(&interface->dev, "dlfb_usb_probe: failed alloc of dev struct\n"); + if (!dev) goto error; - } kref_init(&dev->kref); /* matching kref_put in usb .disconnect fn */