From patchwork Fri Nov 24 20:52:19 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: 10074581 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 2B8C360383 for ; Fri, 24 Nov 2017 20:53:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B64B2A246 for ; Fri, 24 Nov 2017 20:53:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 103FE2A248; Fri, 24 Nov 2017 20:53:06 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A06F62A246 for ; Fri, 24 Nov 2017 20:53:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BDE3F6EA02; Fri, 24 Nov 2017 20:53:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E12A6EA02 for ; Fri, 24 Nov 2017 20:53:02 +0000 (UTC) Received: from [192.168.1.3] ([78.53.250.25]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LbrTY-1f1KHj3vO8-00jIdq; Fri, 24 Nov 2017 21:52:56 +0100 Subject: [PATCH 3/4] video: udlfb: Improve a size determination in dlfb_alloc_urb_list() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Bernie Thompson References: <6fb11bb4-2c1d-a939-087b-de31c42328b9@users.sourceforge.net> Message-ID: Date: Fri, 24 Nov 2017 21:52:19 +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:rFWC2GSUetz4zoIqUQ+jNx3+e8BJ6D8n0cDZOGOmlG+Db02UrWY epqV3HBaXDXXjp6hWdUPGI9ZHGyK127f6V3HnCVN24ZwwLpoYn1vjoAx7TzxdfToH+PNwdU Mo/zLEh9beBL2p2E9IWQmLJM2SHki4VQXfXW0nyOjjQjw8LcbU2UcbG7imrRsN/Ffx2bIVI L0kldH8o6DrfeiTMR+zWg== X-UI-Out-Filterresults: notjunk:1; V01:K0:dfNvRCStjaA=:ZevcPhPKDxRB41Fha65oEd Cmmxnw3qYYxn2YYTpKJOY47XNmqDL7Ev05zCYTOHpEvX3HXnMATIBd+qZggV9+IwPwaes8TNi uHSr8HLLk5aYYLtznMsoQhhzMyHGqFgH28FHo6ay7u1QWBpfVoMozs0syhd6KNZrO2WlWiysg Slk4LYwtxJYE0OVMgaV4H3yBVKQA8fxYyzPBL6wKme5A8Nkbs9WRGByy7A/hPw32yaoh7OLSf jmZXZYSjYGsp41DR68iUgb5+M0cxhLtj+xjEuxzQ57WfIG2+tbyTm2awsVnUYRNyXKfqCrSC8 wxqsj7/9WdVQsIS3tpQ0ZIoX6rDhIfFRC17TjIKt6iSoRQO/1ZrWWqTa4ySZjwimz6ddRYVRQ tiGBnJu1TtBEoNtIjn2kTwNWiOHMEQMSPWYK+2967VOwrjw4BoXIDtZE4NVO4VFHUPF2j1R+L VswtPyT8NUOpLYSIYsJ2WpBht7uXUcB5KfM1yyVdWevdjDrnnJbUwz+IDfVXt5LRo7iIGkt84 mv2VMzkMDES8ujIBsj3rr2/UALuj4y75Ssz+n2l5NT/KTTIUalSBlnf1b5iCOpxBxg5aTbaQd Xw9zm2iMSGfHk4MrHmsbmsy6jd3gB5qNoLtE7lAViUO3hiaA27GFHXebIzJir1zzDQIygacq6 ImPm7S9uffN3CLZfZTdb4KLb7s1UCTwnL0ukhTBtzThRJoN7LRyZ5WT81enBIJLEFBaLJmupL wUsZLkdsHk7V37sBqFvq0Nee8dtX/2H9s12Voe4zSfTk1S2pDKV7IntI2DxfnZrQu3hf+zT7F GddacXyhKpp8SsMPSsUNEBMzbIdkf+anp+d7YFWim4YIRe7iBlhfFJiI2AjGlA9HR3Osjl2 Cc: kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 24 Nov 2017 21:30:37 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/video/fbdev/udlfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index cb2d59ca67a4..059883962698 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1867,7 +1867,7 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size) INIT_LIST_HEAD(&dev->urbs.list); while (i < count) { - unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL); + unode = kzalloc(sizeof(*unode), GFP_KERNEL); if (!unode) break; unode->dev = dev;