]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: fas216: fix sense buffer initialization
authorArnd Bergmann <arnd@arndb.de>
Thu, 18 Jan 2018 13:16:38 +0000 (14:16 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 23 Jan 2018 01:04:01 +0000 (20:04 -0500)
commit4489321985cb57688b13f44280a994266720a7c8
treeb7a3dcdb50cf222d2997de26908381921096f9d3
parentb48e7222b5a7fb3cd1776041665a57c86632ce45
scsi: fas216: fix sense buffer initialization

While testing with the ARM specific memset() macro removed, I ran into a
compiler warning that shows an old bug:

drivers/scsi/arm/fas216.c: In function 'fas216_rq_sns_done':
drivers/scsi/arm/fas216.c:2014:40: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]

It turns out that the definition of the scsi_cmd structure changed back
in linux-2.6.25, so now we clear only four bytes (sizeof(pointer))
instead of 96 (SCSI_SENSE_BUFFERSIZE). I did not check whether we
actually need to initialize the buffer here, but it's clear that if we
do it, we should use the correct size.

Fixes: a463511f5be9 ("[SCSI] use dynamically allocated sense buffer")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/arm/fas216.c