mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
scsi: target: fix unsigned comparision with less than zero
Currently an error return is being assigned to an unsigned size_t varianle
and then checked if the result is less than zero which will always be
false. Fix this by making ret ssize_t rather than a size_t.
Fixes: 0322913cab ("scsi: target: Add device product id and revision configfs attributes")
Signed-off-by: Colin Ian King <[email protected]>
Reviewed-by: Mike Christie <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
parent
1943edacef
commit
ee26724af6
1 changed files with 6 additions and 3 deletions
|
|
@ -1267,7 +1267,8 @@ static ssize_t target_wwn_vendor_id_store(struct config_item *item,
|
|||
/* +2 to allow for a trailing (stripped) '\n' and null-terminator */
|
||||
unsigned char buf[INQUIRY_VENDOR_LEN + 2];
|
||||
char *stripped = NULL;
|
||||
size_t len, ret;
|
||||
size_t len;
|
||||
ssize_t ret;
|
||||
|
||||
len = strlcpy(buf, page, sizeof(buf));
|
||||
if (len < sizeof(buf)) {
|
||||
|
|
@ -1322,7 +1323,8 @@ static ssize_t target_wwn_product_id_store(struct config_item *item,
|
|||
/* +2 to allow for a trailing (stripped) '\n' and null-terminator */
|
||||
unsigned char buf[INQUIRY_MODEL_LEN + 2];
|
||||
char *stripped = NULL;
|
||||
size_t len, ret;
|
||||
size_t len;
|
||||
ssize_t ret;
|
||||
|
||||
len = strlcpy(buf, page, sizeof(buf));
|
||||
if (len < sizeof(buf)) {
|
||||
|
|
@ -1377,7 +1379,8 @@ static ssize_t target_wwn_revision_store(struct config_item *item,
|
|||
/* +2 to allow for a trailing (stripped) '\n' and null-terminator */
|
||||
unsigned char buf[INQUIRY_REVISION_LEN + 2];
|
||||
char *stripped = NULL;
|
||||
size_t len, ret;
|
||||
size_t len;
|
||||
ssize_t ret;
|
||||
|
||||
len = strlcpy(buf, page, sizeof(buf));
|
||||
if (len < sizeof(buf)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue