* [PATCH]scsi: check the return value of device_create_file() in powertec.c
@ 2008-05-25 13:18 Qinghuang Feng
2008-05-28 14:42 ` Russell King - ARM Linux
0 siblings, 1 reply; 2+ messages in thread
From: Qinghuang Feng @ 2008-05-25 13:18 UTC (permalink / raw)
To: rmk; +Cc: linux-arm-kernel, linux-kernel
This patch adds code to check the return value of device_create_file() called from powertecscsi_probe() in powertec.c
Signed-off-by: Qinghuang Feng <s3c24xx@gmail.com>
---
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index d9a546d..d695a6d 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -361,7 +361,9 @@ powertecscsi_probe(struct expansion_card
ecard_setirq(ec, &powertecscsi_ops, info);
- device_create_file(&ec->dev, &dev_attr_bus_term);
+ ret = device_create_file(&ec->dev, &dev_attr_bus_term);
+ if (ret)
+ goto out_put;
ret = fas216_init(host);
if (ret)
@@ -399,6 +401,8 @@ powertecscsi_probe(struct expansion_card
out_free:
device_remove_file(&ec->dev, &dev_attr_bus_term);
+
+ out_put:
scsi_host_put(host);
out_region:
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH]scsi: check the return value of device_create_file() in powertec.c
2008-05-25 13:18 [PATCH]scsi: check the return value of device_create_file() in powertec.c Qinghuang Feng
@ 2008-05-28 14:42 ` Russell King - ARM Linux
0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2008-05-28 14:42 UTC (permalink / raw)
To: Qinghuang Feng; +Cc: linux-arm-kernel, linux-kernel
On Sun, May 25, 2008 at 09:18:25PM +0800, Qinghuang Feng wrote:
> This patch adds code to check the return value of device_create_file() called from powertecscsi_probe() in powertec.c
I'd prefer not to kill the driver if device_create_file fails. Just
arrange to print a warning instead (and remember not to unregister
the file if it wasn't created.)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-28 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-25 13:18 [PATCH]scsi: check the return value of device_create_file() in powertec.c Qinghuang Feng
2008-05-28 14:42 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox