[PATCH 03/17] mtd: partitions: Use xstrdup
Sascha Hauer
s.hauer at pengutronix.de
Thu Feb 12 00:54:20 PST 2015
The return value of strdup is not checked. Use xstrdup instead.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/mtd/partition.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/partition.c b/drivers/mtd/partition.c
index e393fa6..033a7d2 100644
--- a/drivers/mtd/partition.c
+++ b/drivers/mtd/partition.c
@@ -160,7 +160,7 @@ struct mtd_info *mtd_add_partition(struct mtd_info *mtd, off_t offset,
part->block_isbad = mtd->block_isbad ? mtd_part_block_isbad : NULL;
part->size = size;
- part->name = strdup(name);
+ part->name = xstrdup(name);
part->master_offset = offset;
part->master = mtd;
--
2.1.4
More information about the barebox
mailing list