From patchwork Sun Nov 26 10:17:25 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: 10075247 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 BE988602BD for ; Sun, 26 Nov 2017 10:17:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8A3828E39 for ; Sun, 26 Nov 2017 10:17:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD73B28E3B; Sun, 26 Nov 2017 10:17:52 +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 56D8F28E39 for ; Sun, 26 Nov 2017 10:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751717AbdKZKRv (ORCPT ); Sun, 26 Nov 2017 05:17:51 -0500 Received: from mout.web.de ([212.227.15.4]:56169 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbdKZKRu (ORCPT ); Sun, 26 Nov 2017 05:17:50 -0500 Received: from [192.168.1.3] ([78.49.168.181]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MYO5B-1efGMS1f7Z-00VBKH; Sun, 26 Nov 2017 11:17:29 +0100 Subject: [PATCH 1/4] video: sm501fb: Delete error messages for a failed memory allocation in two functions From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Alexey Khoroshilov , Bartlomiej Zolnierkiewicz , Bhumika Goyal , Colin Ian King , "Gustavo A. R. Silva" , Sudip Mukherjee Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <8d053c52-e3e6-32fe-87e9-f01a779b497e@users.sourceforge.net> Date: Sun, 26 Nov 2017 11:17:25 +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: Content-Language: en-GB X-Provags-ID: V03:K0:wr/sqX1ZHi8pQkNiRv7DOPQjoI7iBV307I1m69ppjF9S6w97Fqc thtKIdecEBI/hI18n09Ln3weMnYzi5OuP89ua0mlFw30JRqVlU9dguWgxznrV6xwapoETC1 sf02BFrI2+pE+onlMYR+gMk2UE8Nsg2wC5y1ZWYzYVajdxJSuwfpC27Uk+NFA14+fsKGwxx MmG6S7huhOV/eFAWizS5g== X-UI-Out-Filterresults: notjunk:1; V01:K0:/y2OXoPaj54=:Py41LZ8WYvI/qPNnYLByrx kMp/DE2YiOeomtUMyPETGfxoD/gS8EOMbHUgMVRz5C4bH6vdTUNeATGZduAx10V/KvQNu0ddY 2wbtkKtix7fmOdrBKyzZH2wmEhMyd2JdxvMvcjCItQrihuZJKGbNAwmjaR9P9ZSIXhEsfRxIC z0Zozj/omm9ayZda3J+El4r7Vj9LLs2bb0H2W38Q3l1t9QeV11K6n+Rcyr3tjR8FbUI7FdhXY 7+TTQoAct1pgkYJvdoa6X87IOg7coGXvbsuFugE8naeqrZmwHOudsCj7mzElxLK2MwSoeLo9P FagRmsGicbRrxuKNJHadabBjA0OlKJst4OC8SQjzaT6zLAAORSt70ZJHI7efTLdJkDgf0LKxv cjIWA5gnaMLodO3DY53HzHNhy7dTkNnLq+g2BUCPyq8CA8ytaf72lS8SEyPaJO7Sdos8h8LOT nMsALHkVd38bqQ29OFn5WoL6KYaQVQGqSuBaN204k60So0446Oc71hFdRl1rfiXe9kyDRPke0 8HBOjyXdOgVhMEc+HMCcEtBmJlSNqTBR3g7TEVd/vkqzP1dCGjzQqKR8wnUFbVI9YLwNmWh5F V5w7aBzr6tTWfAq8ef7Micl2XNw94q7cHFFxPgmhq7ftZ4SfG8PslxxyPG4NSmoF6yVvwBUG0 lvZu7oCn6OLp2GJZ+JOnDzamw24FoTpDVu0N8d+HXUxwxRhS7QWu5um7TCOXF20hJZcn2uK0R dRwzoewKk0iriHe3isC2zXd1+882d3l8YEMbLIhZ00B9E/Uk13FVL1dQBALH9ndpVvrVeyUAm OnKvJ/QxJz+vfPdZMS6E+AuY2HVUeQfctxKs9SXVV3vaP+857c= 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: Sun, 26 Nov 2017 10:10:31 +0100 Omit extra messages 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/sm501fb.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index 6f0a19501c6a..e8301c4e7d44 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -1934,10 +1934,8 @@ static int sm501fb_probe(struct platform_device *pdev) /* allocate our framebuffers */ info = kzalloc(sizeof(struct sm501fb_info), GFP_KERNEL); - if (!info) { - dev_err(dev, "failed to allocate state\n"); + if (!info) return -ENOMEM; - } info->dev = dev = &pdev->dev; platform_set_drvdata(pdev, info); @@ -2121,16 +2119,12 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info, /* backup copies in case chip is powered down over suspend */ par->store_fb = vmalloc(par->screen.size); - if (par->store_fb == NULL) { - dev_err(info->dev, "no memory to store screen\n"); + if (!par->store_fb) return -ENOMEM; - } par->store_cursor = vmalloc(par->cursor.size); - if (par->store_cursor == NULL) { - dev_err(info->dev, "no memory to store cursor\n"); + if (!par->store_cursor) goto err_nocursor; - } dev_dbg(info->dev, "suspending screen to %p\n", par->store_fb); dev_dbg(info->dev, "suspending cursor to %p\n", par->store_cursor);