From: Roland Hieber <rhi@pengutronix.de>
To: Barebox Mailing List <barebox@lists.infradead.org>
Subject: Re: [PATCH] ubi: prevent null pointer reference
Date: Mon, 21 Jan 2019 17:55:50 +0100 [thread overview]
Message-ID: <20190121165550.pcfwruyaaaglm7zp@pengutronix.de> (raw)
In-Reply-To: <20190121162926.26051-1-rhi@pengutronix.de>
On Mon, Jan 21, 2019 at 05:29:26PM +0100, Roland Hieber wrote:
> diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
> index 6959564a13..68302f4a33 100644
> --- a/drivers/mtd/ubi/vtbl.c
> +++ b/drivers/mtd/ubi/vtbl.c
> @@ -850,6 +850,12 @@ int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai)
> out_free:
> vfree(ubi->vtbl);
> for (i = 0; i < ubi->vtbl_slots + UBI_INT_VOL_COUNT; i++) {
> +
> + dev_vdbg(&ubi->dev, "destroying fastmap %d: 0x%x\n", i, ubi->volumes[i]);
> +
> + if (!ubi->volumes[i])
> + continue;
> +
> ubi_fastmap_destroy_checkmap(ubi->volumes[i]);
No wait. I should rather check in ubi_fastmap_destroy_checkmap(). Will
send v2.
- Roland
> kfree(ubi->volumes[i]);
> ubi->volumes[i] = NULL;
> --
> 2.20.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Roland Hieber | r.hieber@pengutronix.de |
Pengutronix e.K. | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-01-21 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-21 16:29 Roland Hieber
2019-01-21 16:55 ` Roland Hieber [this message]
2019-01-21 16:56 ` [PATCH v2] " Roland Hieber
2019-01-22 7:12 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190121165550.pcfwruyaaaglm7zp@pengutronix.de \
--to=rhi@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox