media: airspy: fix memory leak in airspy probe
The commitca9dc8d06a
("media: airspy: respect the DMA coherency rules") moves variable buf from stack to heap, however, it only frees buf in the error handling code, missing deallocation in the success path. Fix this by freeing buf in the success path since this variable does not have any references in other code. Fixes:ca9dc8d06a
("media: airspy: respect the DMA coherency rules") Reported-by: syzbot+bb25f85e5aa482864dc0@syzkaller.appspotmail.com Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com> Reviewed-by: Tommaso Merciai <tommaso.merciai@amarulasolution.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Родитель
d682869daa
Коммит
23bc5eb55f
|
@ -1070,6 +1070,10 @@ static int airspy_probe(struct usb_interface *intf,
|
|||
ret);
|
||||
goto err_free_controls;
|
||||
}
|
||||
|
||||
/* Free buf if success*/
|
||||
kfree(buf);
|
||||
|
||||
dev_info(s->dev, "Registered as %s\n",
|
||||
video_device_node_name(&s->vdev));
|
||||
dev_notice(s->dev, "SDR API is still slightly experimental and functionality changes may follow\n");
|
||||
|
|
Загрузка…
Ссылка в новой задаче