mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Daniel Schultz <d.schultz@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 1/2] ARM: am33xx: Add barebox_update eMMC option
Date: Wed, 9 Sep 2015 09:01:30 +0200	[thread overview]
Message-ID: <20150909070130.GI18700@pengutronix.de> (raw)
In-Reply-To: <1441619994-22444-1-git-send-email-d.schultz@phytec.de>

On Mon, Sep 07, 2015 at 11:59:53AM +0200, Daniel Schultz wrote:
> +static int emmc_mlo_handler(struct bbu_handler *handler, struct bbu_data *data)
> +{
> +	int ret = 0;
> +	int i = 0;
> +	int fd;
> +	const void *image = data->image;
> +	size_t size = data->len;
> +	u8 *part_table = 0;
> +
> +	if (file_detect_type(image, size) != filetype_ch_image) {
> +		pr_err("%s is not a valid ch-image\n", data->imagefile);
> +		return -EINVAL;
> +	}
> +	ret = bbu_confirm(data);
> +	if (ret != 0)
> +		return ret;
> +
> +	fd = open(handler->devicefile, O_WRONLY);
> +	if (fd < 0) {
> +		pr_err("could not open %s: %s\n", handler->devicefile,
> +			errno_str());
> +		return fd;
> +	}
> +
> +	/* save the partition table */
> +	part_table = xmalloc(PART_TABLE_SIZE);

You forgot to free part_table later. I replaced part_table with a static
array while applying.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2015-09-09  7:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-07  9:59 Daniel Schultz
2015-09-07  9:59 ` [PATCH v2 2/2] ARM: am335x: Register eMMC MLO handler Daniel Schultz
2015-09-09  7:01 ` Sascha Hauer [this message]

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=20150909070130.GI18700@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=d.schultz@phytec.de \
    /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