[PATCH]scsi: check the return value of device_create_file() in powertec.c

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <rmk@...>
Cc: <linux-arm-kernel@...>, <linux-kernel@...>
Date: Sunday, May 25, 2008 - 9:18 am

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:

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH]scsi: check the return value of device_create_file() ..., Qinghuang Feng, (Sun May 25, 9:18 am)
Re: [PATCH]scsi: check the return value of device_create_fil..., Russell King - ARM Linux, (Wed May 28, 10:42 am)