lkml.org 
[lkml]   [2013]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] arch: x86: platform: mrst: pr_err() need notice that 'sdev->modalias' may not a NUL terminated string.
On 05/27/2013 03:06 PM, Sebastian Andrzej Siewior wrote:
> On Sun, May 26, 2013 at 04:50:22PM +0800, Chen Gang wrote:
>> >
>> > According to the areas which use "%16.16s" within this file, the
>> > 'sdev->modalias' may not always be a NUL terminated string.
>> >
>> > So need use "%.16s" instead of "%s" in pr_err(), or may cause issue.
> No. spi_match_id() expects a NULL terminated string and I would be suprised if
> it would be otherwise. Therefore moorsetown or this files has to learn to NULL
> terminate its strings.
>

In spi_match_id(), it is 'spi_device', not 'spi_board_info'. ;-)

But all together, it is my fault, the original implementation has no
issue: "I treated SFI_NAME_LEN as SPI_NAME_LEN when strncpy()".

BTW: 'pentry->name' in sfi_parse_devs() may not always be a NUL
terminated string, could you give a check, too ? ;-)


Thanks.
--
Chen Gang

Asianux Corporation


\
 
 \ /
  Last update: 2013-05-27 11:01    [W:0.067 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site