Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754492AbeAJKXw (ORCPT + 1 other); Wed, 10 Jan 2018 05:23:52 -0500 Received: from mout.web.de ([212.227.17.11]:55999 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754098AbeAJKXr (ORCPT ); Wed, 10 Jan 2018 05:23:47 -0500 Subject: [PATCH 2/4] sgi-xpnet: Improve a size determination in xpnet_dev_hard_start_xmit() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Arnd Bergmann , Cliff Whickman , Greg Kroah-Hartman , Robin Holt Cc: LKML References: Message-ID: <41b59f3b-00e4-13e2-2952-50781804b52f@users.sourceforge.net> Date: Wed, 10 Jan 2018 11:23:40 +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:jWvWOUJq7ZoQqzGES+/KahYIw3XRqlSZdd+3nUdSSWeoPWschNj arpixGCChXNTsPqZnugVWLWWSlhfr4OrtqXl6ltVINcZhv2nLNkxx42yckrMIawWEXBeniP /VA+oxZe9CIp49WUgZidfnPL6QtyWzoNVo6Ee+D/50JQHJCbaRp2nCcsEcPWU0bCpgPX6La e0wzJCqitwyHe2yw7kVyQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:aHLmi+ooAJ4=:Kdmkeo5JSWjpUV5GdPCq46 9Uwk5tfP7FG3sZVsfaK6HTyglma419QlYjjWrsKK0o1e3wuZzK03u8s9SOYvD8vKfT5eM8t8k yg/HrRZWEdEkO6yMJGOM2pQshXs8WsmerlOHsoYYApOWc8RiXTqN7r1EICSRKSvk7OLN5tIVc IpVlgedsP6ed29UtxR7ILKP46VRijPp6oGGYsilA2mGpCk7OyzIeyoQWRfclsHlEXgFsoO5Zd XFaAKf4DyZeDM+AiulQFRVjTP+VTrHV9xM4iMkz3EoN8FFXbWA/D1cYRHyMjBvsByHJwK2Jdy UOAu9WOJ+Q4DGBBRtOPuZM1Z73QxahCGmZmWldqJf2+gWyAcqyNe4LzsUsOV/Wrj/lNruEiNi D5001uIvbocPijsylRZ0cLDnj27AzX4y20n6epHNK1mliGPg8R9bv0+Kbik+bFRo+IbW8QFxc 88uQOrO3nkkHs/OLzmzFJdhAx+RpmElrkCRhphYB/1C8M9fEQkHM+J3hNFNItsTDcNY9YGRwH ZMq8r+i7iRZPwyvCdjOYh0WEviMZ2lTPPmXBwaSh4HxvW/B84qzIir+3vyk0LbTzuL/Iq6Fc1 vYVShPR6GHhvrOv9El53OgULrBctmkY/9N3CZlEb9KOf58TC7cIwNZp0C0V5iaC0eJ7V+1QDW 0pj9zyEj/sf2EqT13RHJHA+AHnr0+UqV45nIwlxvvFQxqhJ/zZM1p3nzeBzDY895lSMQRQs/G 1Z4Fo/jW1EocGSYsMUHJcGfC63KvcqnM72OUJ1dBB3hXxoFpUC09cPDc+zWuSNG9kxGZU2QeY Z5JSCAj4hryCgy1QyyK/ttHZ8Ulkez2NszI3YjRX6uPGY/k33c= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Wed, 10 Jan 2018 10:48:25 +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/misc/sgi-xp/xpnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index e13aa6c74028..a4415616c03c 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c @@ -427,7 +427,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) * xpc_send_notifies are relying on this skb. When none * remain, release the skb. */ - queued_msg = kmalloc(sizeof(struct xpnet_pending_msg), GFP_ATOMIC); + queued_msg = kmalloc(sizeof(*queued_msg), GFP_ATOMIC); if (queued_msg == NULL) { dev->stats.tx_errors++; dev_kfree_skb(skb); -- 2.15.1