* [PATCH] UBI: Fix null pointer on error log
@ 2016-07-29 8:44 Camille Constans
2016-07-29 8:51 ` Richard Weinberger
0 siblings, 1 reply; 2+ messages in thread
From: Camille Constans @ 2016-07-29 8:44 UTC (permalink / raw)
To: dedekind1, richard, dwmw2, computersforpeace, linux-mtd; +Cc: Camille Constans
It fixes UBI: Extend UBI layer debug/messaging capabilities
As with this commit ubi_err macro is now:
#define ubi_err(ubi, fmt, ...) pr_err("UBI-%d error: %s: " fmt "\n", \
ubi->ubi_num, __func__, ##__VA_ARGS__)
It leads to a null pointer when used before allocating ubi.
Signed-off-by: Camille Constans <camille.constans@parrot.com>
---
drivers/mtd/ubi/build.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index ef36182..f98bfb9 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -889,7 +889,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
* no sense to attach emulated MTD devices, so we prohibit this.
*/
if (mtd->type == MTD_UBIVOLUME) {
- ubi_err(ubi, "refuse attaching mtd%d - it is already emulated on top of UBI",
+ pr_err("UBI error: refuse attaching mtd%d - it is already emulated on top of UBI\n",
mtd->index);
return -EINVAL;
}
@@ -900,7 +900,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
if (!ubi_devices[ubi_num])
break;
if (ubi_num == UBI_MAX_DEVICES) {
- ubi_err(ubi, "only %d UBI devices may be created",
+ pr_err("UBI error: only %d UBI devices may be created\n",
UBI_MAX_DEVICES);
return -ENFILE;
}
@@ -910,7 +910,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
/* Make sure ubi_num is not busy */
if (ubi_devices[ubi_num]) {
- ubi_err(ubi, "already exists");
+ pr_err("UBI error: ubi%d already exists\n", ubi_num);
return -EEXIST;
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] UBI: Fix null pointer on error log
2016-07-29 8:44 [PATCH] UBI: Fix null pointer on error log Camille Constans
@ 2016-07-29 8:51 ` Richard Weinberger
0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2016-07-29 8:51 UTC (permalink / raw)
To: Camille Constans, dedekind1, dwmw2, computersforpeace, linux-mtd
Camille,
Am 29.07.2016 um 10:44 schrieb Camille Constans:
> It fixes UBI: Extend UBI layer debug/messaging capabilities
> As with this commit ubi_err macro is now:
>
> #define ubi_err(ubi, fmt, ...) pr_err("UBI-%d error: %s: " fmt "\n", \
> ubi->ubi_num, __func__, ##__VA_ARGS__)
>
> It leads to a null pointer when used before allocating ubi.
sorry but a fix for this is already queued:
http://www.spinics.net/lists/stable/msg137428.html
Thanks,
//richard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-29 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-29 8:44 [PATCH] UBI: Fix null pointer on error log Camille Constans
2016-07-29 8:51 ` Richard Weinberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).