Skip to content

Commit

Permalink
[SCSI] libsas: fix test for negative unsigned and typos
Browse files Browse the repository at this point in the history
unsigned req->data_len cannot be negative, and fix =-/-= typo

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Roel Kluin authored and James Bottomley committed Jan 2, 2009
1 parent d38f47a commit a234b11
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/scsi/libsas/sas_host_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req,
break;

case SMP_DISCOVER:
req->data_len =- 16;
if (req->data_len < 0) {
req->data_len -= 16;
if ((int)req->data_len < 0) {
req->data_len = 0;
error = -EINVAL;
goto out;
Expand All @@ -215,8 +215,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req,
break;

case SMP_REPORT_PHY_SATA:
req->data_len =- 16;
if (req->data_len < 0) {
req->data_len -= 16;
if ((int)req->data_len < 0) {
req->data_len = 0;
error = -EINVAL;
goto out;
Expand All @@ -238,8 +238,8 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req,
break;

case SMP_PHY_CONTROL:
req->data_len =- 44;
if (req->data_len < 0) {
req->data_len -= 44;
if ((int)req->data_len < 0) {
req->data_len = 0;
error = -EINVAL;
goto out;
Expand Down

0 comments on commit a234b11

Please sign in to comment.