Commit 06e0d8ad authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] Fix leak in PNP interface code.

Spotted with the source checker from Coverity.com.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a857acfe
......@@ -240,12 +240,14 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
{
struct pnp_dev *dev = to_pnp_dev(dmdev);
int i, ret;
pnp_info_buffer_t *buffer = (pnp_info_buffer_t *)
pnp_alloc(sizeof(pnp_info_buffer_t));
if (!buffer)
return -ENOMEM;
pnp_info_buffer_t *buffer;
if (!dev)
return -EINVAL;
buffer = (pnp_info_buffer_t *) pnp_alloc(sizeof(pnp_info_buffer_t));
if (!buffer)
return -ENOMEM;
buffer->len = PAGE_SIZE;
buffer->buffer = buf;
buffer->curr = buffer->buffer;
......
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