lkml.org 
[lkml]   [2008]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] /fs/partition/check.c: fix return value warning
Date
fs/partitions/check.c:381: warning: ignoring return value of ‘device_add’,
declared with attribute warn_unused_result

Signed-off-by: Abdel Benamrouche <draconux@gmail.com>
---
:100644 100644 6149e4b... 7a87fad... M fs/partitions/check.c
fs/partitions/check.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 6149e4b..7a87fad 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -378,7 +378,13 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len,

/* delay uevent until 'holders' subdir is created */
p->dev.uevent_suppress = 1;
- device_add(&p->dev);
+ if (device_add(&p->dev)) {
+ put_device(&p->dev);
+ free_part_stats(p);
+ kfree(p);
+ return;
+ }
+
partition_sysfs_add_subdir(p);
p->dev.uevent_suppress = 0;
if (flags & ADDPART_FLAG_WHOLEDISK)
--
1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-05-10 14:21    [W:0.587 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site