Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932637AbdDEPFH (ORCPT ); Wed, 5 Apr 2017 11:05:07 -0400 Received: from mout.web.de ([212.227.17.12]:52438 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755114AbdDEPEy (ORCPT ); Wed, 5 Apr 2017 11:04:54 -0400 Subject: Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata() To: Yuval Shaia Cc: linux-rdma@vger.kernel.org, Doug Ledford , Hal Rosenstock , Mike Marciniszyn , Sean Hefty , LKML , kernel-janitors@vger.kernel.org References: <20170405143242.GB5006@yuval-lap> From: SF Markus Elfring Message-ID: <523b0864-e655-ed1f-8fe5-5995e0b0bde1@users.sourceforge.net> Date: Wed, 5 Apr 2017 17:04:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <20170405143242.GB5006@yuval-lap> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:aZggixk8CH96Oo2fyzbCMDhWuHkizlcCjUVt19ousY9TnGtkv1Z MzGFeIZxOQj5rj74MZ8gbA/3X5H3Dwj1sYRLuBettYssroiR9PcD92/Fq4tV00mAZvQI9hd FGK6WGBHqQG/ZhvZWMDvlyVc+nBZI69TPxDz65Nv0J28UngYYHacOKP/++U87WI0/gqxcU2 jtIheYs3SuHsC6Lu+XIXA== X-UI-Out-Filterresults: notjunk:1;V01:K0:MLU/3jD0Hhs=:CY5cTf+HQLtRUZM+SkZWYR y4exn/Uxmg6X4QNUdSP5VstUOio+cvj7vIxDdKu43y32y0MFGgiQEgTgOXC49bH6tMVR90Gsu m1C+UJvjX3EQqX73hufLTnx8tqJ8UZnJ+ZWgpE8cnblCR96SYhQEfMvsX0eC9eR9z4oMurk3I z34DiaZcwBclAPJWWTrMR3xskBsQ3qLhZwxuKCHxqilwWhD9pyXfDQzM8eryHl6jfSHSzpjKl LWGleKcBgJH5omfWHCvo0Mcdc1/nDWamwXDra+IeCusDQDIjABocZMC3jRGMUQPXjJquBNODP jru52JQEhB7GYxipbOhaQgdmBLOx3UrKDrb2VWwfzKhJMO7pQk2Q59WzZpkeseyk4502/DHwV X5G43T2CIiBvCG5BpFdixrfQvhhqK1fVQJ00AscJ3mgJoCb/t0/Cdg2XOwHfQadyH36RDo+fx ZszLAncUtDofBjqbiVK7fKwXiQOVHeucbCuT3nwsH9gUuK3/zC3mxaZB32C4ZYIob8/pL0ucZ oR+nS1OpX5yrrGCrh1M795++8sZa2D0zm7Bs7IPCctBRVe5eznci6JSUgY1CCUgUeO2ijasiy RbUcbvIEC68qgbey8TRYSK79L5oti74zPCWlFWdk/IKYOPY0OUhQmmiGs7tTmxadLATzY6vqs u5yKqbfuEwb80IYUe+F46662QjEF1d0qdN01XAbq3ZXSwg+UlOVQRmq0+TZboIeqydvAH+H+y eETJSQ3eUfHEvmD7BsAmvLb/oDYaYu2PNQjTZ9lAkg48ap0T7ClC7XYoo603EGD/VpszLF2Dg P4Z0/J8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 32 >> @@ -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()"? > Besides that: > Reviewed-by: Yuval Shaia Do you find the proposed change for the shown data types really acceptable in these function calls? Regards, Markus