Skip to contentSkip to conversation

drivers:pcmcia:m32r_pcc:Check return value of request_region()

PATCH New nobble 1 participant 1 message Jun 15, 2017 Pcmcia

lore
Share & tools
lore

nobble

author
#0 lore raw

PATCH 1/1 drivers:pcmcia:m32r_pcc:Check return value of request_region()

request_region() can fail here and check its return value

---
 drivers/pcmcia/m32r_pcc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pcmcia/m32r_pcc.c +2 -1
index e50bbf8..5ab241a 100644
@@ -316,7 +316,8 @@ static int add_pcc_socket(ulong base, int irq, ulong mapaddr,
 
 	/* add pcc */
 	if (t->base > 0) {
-		request_region(t->base, 0x20, "m32r-pcc");
+		if (!request_region(t->base, 0x20, "m32r-pcc"))
+			return -EBUSY;
 	}
 
 	printk(KERN_INFO "  %s ", pcc[pcc_sockets].name);
Signature · 1 line
1.9.1