LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PCMCIA] Check return status of register calls in i82365
Date: Fri, 21 May 2004 21:55:29 +1000 [thread overview]
Message-ID: <20040521115529.GA1408@gondor.apana.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
Hi:
i82365 calls driver_register and platform_device_register without
checking their return values. This patch fixes that.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1399 bytes --]
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1808 -> 1.1809
# drivers/pcmcia/i82365.c 1.51 -> 1.52
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/05/21 herbert@gondor.apana.org.au 1.1809
# [PCMCIA] Check return status of register calls in i82365.
# --------------------------------------------
#
diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
--- a/drivers/pcmcia/i82365.c Fri May 21 21:53:42 2004
+++ b/drivers/pcmcia/i82365.c Fri May 21 21:53:42 2004
@@ -1372,8 +1372,15 @@
{
int i, ret;
- if (driver_register(&i82365_driver))
- return -1;
+ ret = driver_register(&i82365_driver);
+ if (ret)
+ return ret;
+
+ ret = platform_device_register(&i82365_device);
+ if (ret) {
+ driver_unregister(&i82365_driver);
+ return ret;
+ }
printk(KERN_INFO "Intel ISA PCIC probe: ");
sockets = 0;
@@ -1382,11 +1389,10 @@
if (sockets == 0) {
printk("not found.\n");
+ platform_device_unregister(&i82365_device);
driver_unregister(&i82365_driver);
return -ENODEV;
}
-
- platform_device_register(&i82365_device);
/* Set up interrupt handler(s) */
if (grab_irq != 0)
next reply other threads:[~2004-05-21 11:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-21 11:55 Herbert Xu [this message]
2004-05-21 23:41 ` Andrew Morton
2004-05-21 23:46 ` Herbert Xu
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=20040521115529.GA1408@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--subject='Re: [PCMCIA] Check return status of register calls in i82365' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).