lkml.org 
[lkml]   [2017]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()
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 <yuval.shaia@oracle.com>
>
> 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

\
 
 \ /
  Last update: 2017-04-05 17:17    [W:1.123 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site