Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()

2017-04-05 Thread Yuval Shaia
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); >

Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()

2017-04-05 Thread Yuval Shaia
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); >

Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()

2017-04-05 Thread Bart Van Assche
On Wed, 2017-04-05 at 15:55 +0200, SF Markus Elfring wrote: > - size = sizeof(struct ib_cc_congestion_setting_attr); > - ppd->congestion_entries_shadow = kzalloc(size, GFP_KERNEL); > + ppd->congestion_entries_shadow = kzalloc(sizeof(*ppd > +

Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()

2017-04-05 Thread Bart Van Assche
On Wed, 2017-04-05 at 15:55 +0200, SF Markus Elfring wrote: > - size = sizeof(struct ib_cc_congestion_setting_attr); > - ppd->congestion_entries_shadow = kzalloc(size, GFP_KERNEL); > + ppd->congestion_entries_shadow = kzalloc(sizeof(*ppd > +

Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()

2017-04-05 Thread SF Markus Elfring
>> @@ -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); >> +

Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()

2017-04-05 Thread SF Markus Elfring
>> @@ -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); >> +

Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()

2017-04-05 Thread Yuval Shaia
On Wed, Apr 05, 2017 at 03:55:39PM +0200, SF Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 5 Apr 2017 15:00:44 +0200 > > * Replace the specification of two data structures by pointer dereferences > to make the corresponding size determination a bit

Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()

2017-04-05 Thread Yuval Shaia
On Wed, Apr 05, 2017 at 03:55:39PM +0200, SF Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 5 Apr 2017 15:00:44 +0200 > > * Replace the specification of two data structures by pointer dereferences > to make the corresponding size determination a bit safer according to > the Linux