[PATCH 29/42] staging: unisys: visorchipset: remove local_addr in handle_command

Dan Carpenter dan.carpenter at oracle.com
Tue Jul 18 08:45:01 UTC 2017


On Mon, Jul 17, 2017 at 04:17:09PM -0400, David Kershner wrote:
> +	mapping = memremap(addr, bytes, MEMREMAP_WB);
> +	if (!mapping)
> +		goto err_finish_ctx;

This goto is wrong.  It calls parser_done(ctx) when it should just call
kfree(ctx).  The difference is that parser_done() looks like this:

   289  static void parser_done(struct parser_context *ctx)
   290  {
   291          chipset_dev->controlvm_payload_bytes_buffered -= ctx->param_bytes;
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We never incremented this so we shouldn't be decrementing it.

   292          kfree(ctx);
   293  }


regards,
dan carpenter



More information about the devel mailing list