[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20170615151159.GA3016@rjk-ThinkPad-E560>
Date: Thu, 15 Jun 2017 23:11:59 +0800
From: nobble <nobbleren@...il.com>
To: linux-pcmcia@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drivers:pcmcia:m32r_pcc:Check return value of
request_region()
request_region() can fail here and check its return value
Signed-off-by: nobbleRen <nobbleren@...il.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
Powered by blists - more mailing lists