summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_devinfo.c
diff options
context:
space:
mode:
authorMartin Wilck <mwilck@suse.com>2018-04-18 01:35:09 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2018-04-21 01:14:35 +0200
commit358fda5ff4c441dfa6e66fd3b1f7d8f882ecba8f (patch)
treeca98c94036d81fb7d6c5a6210819a2a52b63bb3d /drivers/scsi/scsi_devinfo.c
parentscsi: devinfo: change blist_flag_t to 64bit (diff)
downloadlinux-358fda5ff4c441dfa6e66fd3b1f7d8f882ecba8f.tar.xz
linux-358fda5ff4c441dfa6e66fd3b1f7d8f882ecba8f.zip
scsi: devinfo: warn on undefined blist flags
Warn if a device (or the user) sets blist flags which are unknown or have been removed. This should enable us to reuse freed blist bits in later releases. Signed-off-by: Martin Wilck <mwilck@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_devinfo.c')
-rw-r--r--drivers/scsi/scsi_devinfo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index bd04a33e4360..9603f3ef18aa 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -370,6 +370,12 @@ int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model,
}
flags = (__force blist_flags_t)val;
}
+ if (flags & __BLIST_UNUSED_MASK) {
+ pr_err("scsi_devinfo (%s:%s): unsupported flags 0x%llx",
+ vendor, model, flags & __BLIST_UNUSED_MASK);
+ kfree(devinfo);
+ return -EINVAL;
+ }
devinfo->flags = flags;
devinfo->compatible = compatible;