From: nobble <nobbleren@gmail.com>
To: linux-pcmcia@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drivers:pcmcia:m32r_pcc:Check return value of request_region()
Date: Thu, 15 Jun 2017 23:11:59 +0800 [thread overview]
Message-ID: <20170615151159.GA3016@rjk-ThinkPad-E560> (raw)
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
reply other threads:[~2017-06-15 15:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170615151159.GA3016@rjk-ThinkPad-E560 \
--to=nobbleren@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pcmcia@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®