Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932327AbdDEPQF (ORCPT ); Wed, 5 Apr 2017 11:16:05 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:32367 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752890AbdDEPPs (ORCPT ); Wed, 5 Apr 2017 11:15:48 -0400 Date: Wed, 5 Apr 2017 18:15:26 +0300 From: Yuval Shaia To: SF Markus Elfring Cc: linux-rdma@vger.kernel.org, Doug Ledford , Hal Rosenstock , Mike Marciniszyn , Sean Hefty , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata() Message-ID: <20170405151525.GA5519@yuval-lap> References: <20170405143242.GB5006@yuval-lap> <523b0864-e655-ed1f-8fe5-5995e0b0bde1@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <523b0864-e655-ed1f-8fe5-5995e0b0bde1@users.sourceforge.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 39 On Wed, Apr 05, 2017 at 05:04:35PM +0200, SF Markus Elfring wrote: > >> @@ -270,13 +268,14 @@ int qib_init_pportdata(struct qib_pportdata *ppd, struct qib_devdata *dd, > >> if (!ppd->congestion_entries) > >> goto bail_1; > >> > >> - size = sizeof(struct cc_table_shadow); > >> - ppd->ccti_entries_shadow = kzalloc(size, GFP_KERNEL); > >> + ppd->ccti_entries_shadow = kzalloc(sizeof(*ppd->ccti_entries_shadow), > >> + GFP_KERNEL); > >> if (!ppd->ccti_entries_shadow) > >> goto bail_2; > >> > >> - size = sizeof(struct ib_cc_congestion_setting_attr); > >> - ppd->congestion_entries_shadow = kzalloc(size, GFP_KERNEL); > >> + ppd->congestion_entries_shadow = kzalloc(sizeof(*ppd > >> + ->congestion_entries_shadow), > >> + GFP_KERNEL); > > > > Not related to this patch but is related to your patch-set - can you check > > the array allocations in lines 264 and 268? > > Do you refer to source code places here which are affected by the update step > "[PATCH 4/5] IB/qib: Use kcalloc() in qib_init_pportdata()"? Oops, please ignore. > > > > Besides that: > > Reviewed-by: Yuval Shaia > > Do you find the proposed change for the shown data types really acceptable > in these function calls? I found that the fix brings no harm to the existing code. > > Regards, > Markus