mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers:pcmcia:m32r_pcc:Check return value of request_region()
@ 2017-06-15 15:11 nobble
  0 siblings, 0 replies; only message in thread
From: nobble @ 2017-06-15 15:11 UTC (permalink / raw)
  To: linux-pcmcia, linux-kernel

request_region() can fail here and check its return value

Signed-off-by: nobbleRen <nobbleren@gmail.com>
---
 drivers/pcmcia/m32r_pcc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index e50bbf8..5ab241a 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -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);
-- 
1.9.1

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

only message in thread, other threads:[~2017-06-15 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15 15:11 [PATCH] drivers:pcmcia:m32r_pcc:Check return value of request_region() nobble

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®