Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -441,8 +441,10 @@ static int gasket_config_coherent_allocator(
			gasket_dev, ibuf.size, &ibuf.dma_address,
			ibuf.page_table_index);
	}
	if (ret)
		return ret;
	if (copy_to_user(argp, &ibuf, sizeof(ibuf)))
		return -EFAULT;

	return ret;
	return 0;
}