lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200811071522.43618.elendil@planet.nl>
Date:	Fri, 7 Nov 2008 15:22:42 +0100
From:	Frans Pop <elendil@...net.nl>
To:	linux-kernel@...r.kernel.org
Cc:	linux@...inikbrodowski.net, dbrownell@...rs.sourceforge.net,
	linux-pcmcia@...ts.infradead.org
Subject: [PATCH] pcmcia: ensure correct logging in do_io_probe [v2]

I've added parens around the conditions. Maybe not strictly needed,
but better readable and consistent with similar usage in cs.c.

Cheers,
FJP

---
From: Frans Pop <elendil@...net.nl>

pcmcia: ensure correct logging in do_io_probe
    
During early probing of the parent PCI bridge I/O window no socket
has been allocated yet.
In that case print &s->cb_dev->dev instead of &s->dev as device.
    
Also properly close previous dev_printk if kzalloc fails.

Signed-off-by: Frans Pop <elendil@...net.nl>
CC: Dominik Brodowski <linux@...inikbrodowski.net>

diff --git a/drivers/pcmcia/rsrc_nonstatic.c 
b/drivers/pcmcia/rsrc_nonstatic.c
index 17f4ecf..2a6a3d1 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -200,14 +200,17 @@ static void do_io_probe(struct pcmcia_socket *s, 
unsigned int base,
     int any;
     u_char *b, hole, most;
 
-    dev_printk(KERN_INFO, &s->dev, "cs: IO port probe %#x-%#x:",
-	       base, base+num-1);
+    dev_printk(KERN_INFO,
+	       (s->state & SOCKET_PRESENT) ? &s->dev : &s->cb_dev->dev,
+	       "cs: IO port probe %#x-%#x:", base, base+num-1);
 
     /* First, what does a floating port look like? */
     b = kzalloc(256, GFP_KERNEL);
     if (!b) {
-	    dev_printk(KERN_ERR, &s->dev,
-		   "do_io_probe: unable to kmalloc 256 bytes");
+	    printk("\n");
+	    dev_printk(KERN_ERR,
+		   (s->state & SOCKET_PRESENT) ? &s->dev : &s->cb_dev->dev,
+		   "cs: do_io_probe: unable to kmalloc 256 bytes");
             return;
     }
     for (i = base, most = 0; i < base+num; i += 8) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ