Skip to contentSkip to conversation

check return value of request_region in

PATCH New Darren Jenkins\ 1 participant 1 message Mar 1, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check return value of request_region in

G'day list,

Sorry about the last '2' patches now, and thanks Tim for spotting the missing '\n', in the last patch. (I'm going to bed now because it appears I need some sleep.)

ali5455.c calls request_region without checking it's return value @ line 3460.

The patch below simply checks the return value and copies local error style.

sound/oss/ali5455.c renamed from sound/oss/ali5455.c.orig +7 -1
@@ -3457,7 +3457,13 @@ static int __devinit ali_probe(struct pc
 	card->channel[4].port = 0xb0;
 	card->channel[4].num = 4;
 	/* claim our iospace and irq */
-	request_region(card->iobase, 256, card_names[pci_id->driver_data]);
+	if (!request_region(card->iobase, 256, 
+				card_names[pci_id->driver_data])) {
+		printk(KERN_ERR "ali_audio: request_region failed\n");
+		kfree(card);
+		return -EBUSY;
+	}
+	
 	if (request_irq(card->irq, &ali_interrupt, SA_SHIRQ,
 			card_names[pci_id->driver_data], card)) {
 		printk(KERN_ERR "ali_audio: unable to allocate irq %d\n",

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors