Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1617031

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

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject Re: [PATCH 5/5] IB/qib: Adjust two size determinations in qib_init_pportdata()
Date 2017-04-05 17:10 +0200
Message-ID <tsUJk-4eA-11@gated-at.bofh.it> (permalink)
References <tsTDz-3ln-1@gated-at.bofh.it> <tsTNh-3DV-61@gated-at.bofh.it> <tsUgj-3Nd-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> @@ -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 <yuval.shaia@oracle.com>

Do you find the proposed change for the shown data types really acceptable
in these function calls?

Regards,
Markus

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] IB/qib: Fine-tuning for four function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 16:00 +0200
  [PATCH 2/5] IB/qib: Use kmalloc_array() in qib_init_7322_variables() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 16:00 +0200
    Re: [PATCH 2/5] IB/qib: Use kmalloc_array() in  qib_init_7322_variables() Yuval Shaia <yuval.shaia@oracle.com> - 2017-04-05 16:30 +0200
  [PATCH 1/5] IB/qib: Use kcalloc() in qib_init_iba7322_funcs() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 16:00 +0200
    Re: [PATCH 1/5] IB/qib: Use kcalloc() in qib_init_iba7322_funcs() Yuval Shaia <yuval.shaia@oracle.com> - 2017-04-05 16:40 +0200
      Re: [PATCH 1/5] IB/qib: Use kcalloc() in qib_init_iba7322_funcs() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 17:00 +0200
        Re: [PATCH 1/5] IB/qib: Use kcalloc() in qib_init_iba7322_funcs() Johannes Thumshirn <jthumshirn@suse.de> - 2017-04-05 17:10 +0200
          Re: [PATCH 1/5] IB/qib: Use kcalloc() in qib_init_iba7322_funcs() Yuval Shaia <yuval.shaia@oracle.com> - 2017-04-05 17:20 +0200
  [PATCH 3/5] IB/qib: Use kcalloc() in qib_alloc_devdata() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 16:00 +0200
  [PATCH 4/5] IB/qib: Use kcalloc() in qib_init_pportdata() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 16:00 +0200
  [PATCH 5/5] IB/qib: Adjust two size determinations in  qib_init_pportdata() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 16:10 +0200
    Re: [PATCH 5/5] IB/qib: Adjust two size determinations in  qib_init_pportdata() Yuval Shaia <yuval.shaia@oracle.com> - 2017-04-05 16:40 +0200
      Re: [PATCH 5/5] IB/qib: Adjust two size determinations in  qib_init_pportdata() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 17:10 +0200
        Re: [PATCH 5/5] IB/qib: Adjust two size determinations in  qib_init_pportdata() Yuval Shaia <yuval.shaia@oracle.com> - 2017-04-05 17:20 +0200
          Re: IB/qib: Adjust two size determinations in qib_init_pportdata() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-05 17:30 +0200
            Re: IB/qib: Adjust two size determinations in qib_init_pportdata() Yuval Shaia <yuval.shaia@oracle.com> - 2017-04-06 21:50 +0200
              Re: IB/qib: Adjust two size determinations in qib_init_pportdata() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-06 22:40 +0200
    Re: [PATCH 5/5] IB/qib: Adjust two size determinations in  qib_init_pportdata() Bart Van Assche <Bart.VanAssche@sandisk.com> - 2017-04-05 17:20 +0200
  Re: [PATCH 0/5] IB/qib: Fine-tuning for four function implementations Dennis Dalessandro <dennis.dalessandro@intel.com> - 2017-04-06 02:40 +0200

csiph-web