mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 16:19:53 +00:00
[media] stk-webcam: Delete an unnecessary check before the function call "vfree"
The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
d585c1e14a
commit
704b3f4c11
@ -556,10 +556,8 @@ static int stk_free_sio_buffers(struct stk_camera *dev)
|
||||
nbufs = dev->n_sbufs;
|
||||
dev->n_sbufs = 0;
|
||||
spin_unlock_irqrestore(&dev->spinlock, flags);
|
||||
for (i = 0; i < nbufs; i++) {
|
||||
if (dev->sio_bufs[i].buffer != NULL)
|
||||
vfree(dev->sio_bufs[i].buffer);
|
||||
}
|
||||
for (i = 0; i < nbufs; i++)
|
||||
vfree(dev->sio_bufs[i].buffer);
|
||||
kfree(dev->sio_bufs);
|
||||
dev->sio_bufs = NULL;
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user