Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a234b110 authored by Roel Kluin's avatar Roel Kluin Committed by James Bottomley
Browse files

[SCSI] libsas: fix test for negative unsigned and typos



unsigned req->data_len cannot be negative, and fix =-/-= typo

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent d38f47a9
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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;
@@ -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;