Commit 5c4a5d3d authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman

staging: gasket: avoid copy to user on error in coherent alloc config

gasket_config_coherent_allocator() on error return the error to caller
without copying a possibly-update DMA address back to userspace.
Reported-by: default avatarDmitry Torokhov <dtor@chromium.org>
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8fc1cb4c
...@@ -441,8 +441,10 @@ static int gasket_config_coherent_allocator( ...@@ -441,8 +441,10 @@ static int gasket_config_coherent_allocator(
gasket_dev, ibuf.size, &ibuf.dma_address, gasket_dev, ibuf.size, &ibuf.dma_address,
ibuf.page_table_index); ibuf.page_table_index);
} }
if (ret)
return ret;
if (copy_to_user(argp, &ibuf, sizeof(ibuf))) if (copy_to_user(argp, &ibuf, sizeof(ibuf)))
return -EFAULT; return -EFAULT;
return ret; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment