Skip to content

Commit

Permalink
scsi: smartpqi: Replace one-element array with flexible-array member
Browse files Browse the repository at this point in the history
One-element arrays are deprecated, and we are replacing them with flexible
array members instead. So, replace one-element array with flexible-array
member in struct report_log_lun_list.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines
on memcpy().

Link: KSPP#79
Link: KSPP#204
Acked-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
  • Loading branch information
GustavoARSilva authored and intel-lab-lkp committed Feb 7, 2023
1 parent e9f87b5 commit f92f3f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/scsi/smartpqi/smartpqi.h
Expand Up @@ -954,7 +954,7 @@ struct report_log_lun {

struct report_log_lun_list {
struct report_lun_header header;
struct report_log_lun lun_entries[1];
struct report_log_lun lun_entries[];
};

struct report_phys_lun_8byte_wwid {
Expand Down
3 changes: 2 additions & 1 deletion drivers/scsi/smartpqi/smartpqi_init.c
Expand Up @@ -1259,7 +1259,8 @@ static int pqi_get_device_lists(struct pqi_ctrl_info *ctrl_info,
"report logical LUNs failed\n");

/*
* Tack the controller itself onto the end of the logical device list.
* Tack the controller itself onto the end of the logical device list
* by adding a list entry that is all zeros.
*/

logdev_data = *logdev_list;
Expand Down

0 comments on commit f92f3f9

Please sign in to comment.