Commit ead82126 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Martin K. Petersen
Browse files

scsi: smartpqi: Replace one-element array with flexible-array member

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: https://lore.kernel.org/r/Y+LJz/r6+UeLqnV3@work
Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/204


Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: default avatarDon Brace <don.brace@microchip.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 54dd9601
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+2 −1
Original line number Diff line number Diff line
@@ -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;