OSDN Git Service

scsi: scsi_devinfo: cleanly zero-pad devinfo strings
authorMartin Wilck <mwilck@suse.com>
Mon, 27 Nov 2017 22:47:35 +0000 (23:47 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Dec 2017 02:58:35 +0000 (21:58 -0500)
commit81df022b688d43d2a3667518b2f755d384397910
tree94be75c5aef9b3260945238cbc25ad47bbc3bdbf
parentba69ead9e9e9bb3cec5faf03526c36764ac8942a
scsi: scsi_devinfo: cleanly zero-pad devinfo strings

Cleanly fill memory for "vendor" and "model" with 0-bytes for the
"compatible" case rather than adding only a single 0 byte.  This
simplifies the devinfo code a a bit, and avoids mistakes in other places
of the code (not in current upstream, but we had one such mistake in the
SUSE kernel).

[mkp: applied by hand and added braces]

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_devinfo.c