提交 f5166e59 编写于 作者: N Navid Emamdoost 提交者: Xie XiuQi

media: rc: prevent memory leak in cx23888_ir_probe

mainline inclusion
from mainline-v5.4
commit a7b2df76
category: bugfix
bugzilla: 13690
CVE: CVE-2019-19054

-------------------------------------------------

In cx23888_ir_probe if kfifo_alloc fails the allocated memory for state
should be released.
Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: NSean Young <sean@mess.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NWenan Mao <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 57d09d7d
...@@ -1178,8 +1178,11 @@ int cx23888_ir_probe(struct cx23885_dev *dev) ...@@ -1178,8 +1178,11 @@ int cx23888_ir_probe(struct cx23885_dev *dev)
return -ENOMEM; return -ENOMEM;
spin_lock_init(&state->rx_kfifo_lock); 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; return -ENOMEM;
}
state->dev = dev; state->dev = dev;
sd = &state->sd; sd = &state->sd;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册