[dpdk-dev] [PATCH] net/mrvl: fix build error with gcc

Ferruh Yigit ferruh.yigit at intel.com
Tue Mar 27 21:11:05 CEST 2018


On 3/23/2018 7:52 AM, Tomasz Duszynski wrote:
> On Thu, Mar 22, 2018 at 06:18:47PM +0000, Ferruh Yigit wrote:
>> gcc version:
>> aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011
>>
>> build error:
>>   CC mrvl_qos.o
>> .../drivers/net/mrvl/mrvl_qos.c: In function ‘mrvl_configure_rxqs’:
>> .../drivers/net/mrvl/mrvl_qos.c:679:17:
>>   error: ‘sprintf’ may write a terminating nul past the end of the
>>          destination [-Werror=format-overflow=]
>>   sprintf(match, "policer-%d:%d\n", priv->pp_id, priv->ppio_id);
>>                  ^~~~~~~~~~~~~~~~~
>> .../drivers/net/mrvl/mrvl_qos.c:679:2:
>>   note: ‘sprintf’ output between 13 and 17 bytes into a destination
>>         of size 16
>>   sprintf(match, "policer-%d:%d\n", priv->pp_id, priv->ppio_id);
>>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Fixed by replacing sprintf to snprintf.
>>
>> Fixes: 8860fd7b70f0 ("net/mrvl: add ingress policer support")
>> Cc: tdu at semihalf.com
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>

> Acked-by: Tomasz Duszynski <tdu at semihalf.com>

Squashed into relevant commit in next-net, thanks.


More information about the dev mailing list