mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
media: rc: prevent memory leak in cx23888_ir_probe
[ Upstream commit a7b2df76b4
]
In cx23888_ir_probe if kfifo_alloc fails the allocated memory for state
should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a42f149865
commit
12273ec840
1 changed files with 4 additions and 1 deletions
|
@ -1178,8 +1178,11 @@ int cx23888_ir_probe(struct cx23885_dev *dev)
|
|||
return -ENOMEM;
|
||||
|
||||
spin_lock_init(&state->rx_kfifo_lock);
|
||||
if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL))
|
||||
if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE,
|
||||
GFP_KERNEL)) {
|
||||
kfree(state);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
state->dev = dev;
|
||||
sd = &state->sd;
|
||||
|
|
Loading…
Reference in a new issue