Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbeACU0C (ORCPT + 1 other); Wed, 3 Jan 2018 15:26:02 -0500 Received: from mout.web.de ([212.227.17.11]:57478 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180AbeACUNZ (ORCPT ); Wed, 3 Jan 2018 15:13:25 -0500 Subject: [PATCH 2/2] wireless: libertas_tf: Improve a size determination in two functions From: SF Markus Elfring To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Arvind Yadav , Kalle Valo , Kees Cook Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <2887651c-f571-120e-1a63-1768db668ee4@users.sourceforge.net> Date: Wed, 3 Jan 2018 21:13:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:5fjAacTcv5yjbeuWGXTo1y/3lSv+zCIrtjYC0BXoxfuCak2FkV+ 4xXLScHRZPOkBhFZVY5LgoZrPQfsrqoZDrRj9k3NzZD0c7t0+yZ+SL2RWlt6xofhlTR9Ky+ 4kV14g5CR/la73C2wwtnrThBy/ETv6kw2xuaRoeJc6Y0kz5+jZi0wnnwMBCvBtRTIzsbOaq 1YUpVvCtP+O9lZ7YD4m9Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:ytBJHxCqm4c=:gXG7E1eIqlrmVeLnUIDJuj 9TLF3eucsSUc0YKfBNvVwwNgMDfsRJSw1dxP4DEApEE8nViVi7DmwlFjX0jXxkC9glv2Xhrqa 8mAHPOGZm/80vMvFcWjMrF1/BeIgmPizuVmNggAHK15qRBsxJ8DJRD5uF0t9+3T005lQfI5f5 gB3W2+QlGVY3G8P+IWcuFfCBBZ5dAD+lvZKC6VgAgEgHc2WBO0wJ9B7awAolaL43syk1c5LHw 66RzS11ZvBTWZnrKUWSVHg9m0sVwJlQWrJqtVOBVKJWh1pGhUXT/+oyWSefLPXYYi88nOakRI 50La/7Ado8VlvYANEzMm+mPXVvdPwiJhLx1PUWSwtH9oftZisZ1O9tiv7B++o62zqxvd0vnnC Z83WmWfRdTuc/Lw0BAaShQ5li8/iwabKB5RxQvo9U/YSYAqReausgxJdjUlVDUPVnsu0S/762 pVcOmFnG+OHSXEmtMGvkVRT35Ii/pfGPku/6gu09pG3WPPT8XHbT24FV1DBpHt9VwENruzE4S Lp7dwwgAHZghHwlf3cJnyAbrek24zQbW9UG+QdEdzc1Kf2bVW3dSrZPfn0J/lQRrI7al9NFzg srGpZXwBqfkHKqurBIQTMArDUSUTm4wy0FuL5MzyaYQyhhZ/Fh/XvY7S6D6ECPPRT3KUbQ94M fjBFvvrjYcZ1d2UwQIvS3ELZhOgOjVXlaLMPx4OQk6yRp6P1ksuSra1fBD5RVWgoMBjjN1RT6 0CETCtxMIsqFqHcgyOE1UNDiqOo9euCtm1/PcZpuxKHgk6R9vtT1ECVrDNa90pIfWvbSDMUK7 rcoEpNuDb61++yM6KcSxk3PC6fXwqxnVfHv5e1R+pjWD9FSOY0= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Wed, 3 Jan 2018 21:02:17 +0100 Replace the specification of data structures by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/net/wireless/marvell/libertas_tf/if_usb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/marvell/libertas_tf/if_usb.c b/drivers/net/wireless/marvell/libertas_tf/if_usb.c index 9eebc84cd15a..98e81a6f2338 100644 --- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c +++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c @@ -152,7 +152,7 @@ static int if_usb_probe(struct usb_interface *intf, lbtf_deb_enter(LBTF_DEB_USB); udev = interface_to_usbdev(intf); - cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL); + cardp = kzalloc(sizeof(*cardp), GFP_KERNEL); if (!cardp) goto error; @@ -536,8 +536,7 @@ static void if_usb_receive_fwload(struct urb *urb) return; } - syncfwheader = kmemdup(skb->data, sizeof(struct fwsyncheader), - GFP_ATOMIC); + syncfwheader = kmemdup(skb->data, sizeof(*syncfwheader), GFP_ATOMIC); if (!syncfwheader) { lbtf_deb_usbd(&cardp->udev->dev, "Failure to allocate syncfwheader\n"); -- 2.15.1