From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762687AbdEVVAr (ORCPT ); Mon, 22 May 2017 17:00:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41100 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762648AbdEVVAi (ORCPT ); Mon, 22 May 2017 17:00:38 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 24E0485365 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vyasevic@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 24E0485365 Reply-To: vyasevic@redhat.com Subject: Re: [PATCH 4/5] sctp: Improve a size determination in sctp_inetaddr_event() References: <2845df67-d35d-536a-0a53-b2eb83fe1ba5@users.sourceforge.net> To: SF Markus Elfring , linux-sctp@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Neil Horman , Vlad Yasevich Cc: LKML , kernel-janitors@vger.kernel.org From: Vlad Yasevich Organization: Red Hat Message-ID: <90582e7d-1e22-cf23-2f51-6630ab1b9bf4@redhat.com> Date: Mon, 22 May 2017 17:00:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 22 May 2017 21:00:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/22/2017 12:40 PM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Mon, 22 May 2017 18:08:24 +0200 > > 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. > > Signed-off-by: Markus Elfring > --- > net/sctp/protocol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c > index 64756c42cec9..057479b7bd72 100644 > --- a/net/sctp/protocol.c > +++ b/net/sctp/protocol.c > @@ -784,7 +784,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, > > switch (ev) { > case NETDEV_UP: > - addr = kmalloc(sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC); > + addr = kmalloc(sizeof(*addr), GFP_ATOMIC); > if (addr) { > addr->a.v4.sin_family = AF_INET; > addr->a.v4.sin_port = 0; > Acked-by: Vlad Yasevich -vlad