mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 1/1] scsi mca_53c9x missing return check for request_region()
@ 2006-03-17 13:33 Laurent Wandrebeck
  0 siblings, 0 replies; only message in thread
From: Laurent Wandrebeck @ 2006-03-17 13:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, jejb

Hi,
in drivers/scsi/mca_53c9x.c, request_region() is called without checking the return
value. Here is a simple patch to fix it.
Patch against 2.6.16-rc6-git8.
Please CC me on replies.
Regards.

Signed-off-by: Laurent Wandrebeck <l.wandrebeck@free.fr>

--- linux-2.6.16-rc6/drivers/scsi/mca_53c9x.c.ori       2006-03-11 23:12:55.000000000 +0100
+++ linux-2.6.16-rc6/drivers/scsi/mca_53c9x.c   2006-03-17 14:20:44.000000000 +0100
@@ -195,7 +195,15 @@ static int mca_esp_detect(struct scsi_ho
                                return 0;
                        }

-                       request_region(tmp_io_addr, 32, "NCR 53c9x SCSI");
+                       if (!request_region(tmp_io_addr, 32, "NCR 53c9x SCSI")) {
+                               printk("Unable to request region %d.\n",
+                                tmp_io_addr);
+                               free_dma(esp->dma);
+                               free_irq(esp->irq, esp_intr);
+                               esp_deallocate(esp);
+                               scsi_unregister(esp->ehost);
+                               return 0;
+                       }

                        /*
                         * 86C01 handles DMA, IO mode, from address


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-17 13:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-17 13:33 [patch 1/1] scsi mca_53c9x missing return check for request_region() Laurent Wandrebeck

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

all inboxes | Powered by JetHome®