Skip to content

Commit

Permalink
media: pci: cx23885: replace BUG with error return
Browse files Browse the repository at this point in the history
[ Upstream commit 2e1796f ]

It was completely unnecessary to use BUG in buffer_prepare().
Just replace it with an error return. This also fixes a smatch warning:

drivers/media/pci/cx23885/cx23885-video.c:422 buffer_prepare() error: uninitialized symbol 'ret'.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Hans Verkuil authored and gregkh committed Sep 23, 2023
1 parent 257092c commit 96a0bf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/pci/cx23885/cx23885-video.c
Expand Up @@ -413,7 +413,7 @@ static int buffer_prepare(struct vb2_buffer *vb)
dev->height >> 1);
break;
default:
BUG();
return -EINVAL; /* should not happen */
}
dprintk(2, "[%p/%d] buffer_init - %dx%d %dbpp 0x%08x - dma=0x%08lx\n",
buf, buf->vb.vb2_buf.index,
Expand Down

0 comments on commit 96a0bf5

Please sign in to comment.