diff options
| author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-07-21 10:23:42 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-09-23 10:48:17 +0200 |
| commit | 0600d5f18a395dc9526c014405772f31122215d4 (patch) | |
| tree | 32351b33244ca04c97e9640af1897ab979639990 | |
| parent | f844bc3a47d8d1c55a4a9cfca38c538e9df7e678 (diff) | |
| download | linux-0600d5f18a395dc9526c014405772f31122215d4.tar.gz linux-0600d5f18a395dc9526c014405772f31122215d4.tar.bz2 linux-0600d5f18a395dc9526c014405772f31122215d4.zip | |
media: pci: cx23885: replace BUG with error return
[ Upstream commit 2e1796fd4904fdd6062a8e4589778ea899ea0c8d ]
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>
| -rw-r--r-- | drivers/media/pci/cx23885/cx23885-video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 2a20c7165e1e..16564899f114 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -420,7 +420,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 \"%s\" - dma=0x%08lx\n", buf, buf->vb.vb2_buf.index, |
