public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata: libata-scsi: fix sloppy result type of ata_ioc32()
@ 2022-06-17 19:30 Sergey Shtylyov
  2022-06-19 23:12 ` Damien Le Moal
  0 siblings, 1 reply; 7+ messages in thread
From: Sergey Shtylyov @ 2022-06-17 19:30 UTC (permalink / raw)
  To: Damien Le Moal, linux-ide

While ata_ioc32() returns *int*, its result gets assigned to and compared
with the *unsigned long* variable 'val' in ata_sas_scsi_ioctl(), its only
caller, which implies a problematic implicit cast -- fix that by returning
*unsigned long* instead.

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
This patch is against the 'for-next' branch of Damien's 'libata.git' repo.

 drivers/ata/libata-scsi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: libata/drivers/ata/libata-scsi.c
===================================================================
--- libata.orig/drivers/ata/libata-scsi.c
+++ libata/drivers/ata/libata-scsi.c
@@ -539,7 +539,7 @@ int ata_task_ioctl(struct scsi_device *s
 	return rc;
 }
 
-static int ata_ioc32(struct ata_port *ap)
+static unsigned long ata_ioc32(struct ata_port *ap)
 {
 	if (ap->flags & ATA_FLAG_PIO_DMA)
 		return 1;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-21 22:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-17 19:30 [PATCH] ata: libata-scsi: fix sloppy result type of ata_ioc32() Sergey Shtylyov
2022-06-19 23:12 ` Damien Le Moal
2022-06-20 20:26   ` Sergey Shtylyov
2022-06-20 22:44     ` Damien Le Moal
2022-06-21 19:14       ` Sergey Shtylyov
2022-06-21 20:37         ` Sergey Shtylyov
2022-06-21 22:15           ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox