OSDN Git Service

scsi: myrs: avoid stack overflow warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 2 Nov 2018 15:44:13 +0000 (16:44 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 6 Nov 2018 03:35:01 +0000 (22:35 -0500)
commit77409c4cdc44560e1b3b839e62d7f73478199680
tree9c81699623c047c86be545defeaa8ed5649e9df7
parentf8d294324598ec85bea2779512e48c94cbe4d7c6
scsi: myrs: avoid stack overflow warning

Putting a 1024 byte data structure on the stack is generally a bad idea.
On 32-bit systems, it also triggers a compile-time warning when building
with -Og:

drivers/scsi/myrs.c: In function 'myrs_get_ctlr_info':
drivers/scsi/myrs.c:212:1: error: the frame size of 1028 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

We only really need three members of the structure, so just read them
manually here instead of copying the entire structure.

Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller (SCSI interface)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/myrs.c