scsi: scsi_devinfo: fixup string compare
When checking the model and vendor string we need to use the minimum value of either string, otherwise we'll miss out on wildcard matches. And we should take care when matching with zero size strings; results might be unpredictable. With this patch the rules for matching devinfo strings are as follows: - Vendor strings must match exactly - Empty Model strings will only match if the devinfo model is also empty - Model strings shorter than the devinfo model string will not match Fixes: 5e7ff2ca ("SCSI: fix new bug in scsi_dev_info_list string matching") Signed-off-by: NHannes Reinecke <hare@suse.com> Reviewed-by: NAlan Stern <stern@rowland.harvard.edu> Reviewed-by: NBart Van Assche <bart.vanassche@wdc.com> Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Showing
想要评论请 注册 或 登录