media: pci: saa7164: replace BUG with error return

It was completely unnecessary to use BUG in saa7164_s_frequency,
just return an error instead. This also solves a smatch error:

drivers/media/pci/saa7164/saa7164-encoder.c:388 saa7164_s_frequency() error: potentially dereferencing uninitialized 'tsport'.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
Hans Verkuil 2023-07-21 10:24:01 +02:00
parent 2e1796fd49
commit c62b089163

View File

@ -383,7 +383,7 @@ int saa7164_s_frequency(struct saa7164_port *port,
else if (port->nr == SAA7164_PORT_ENC2)
tsport = &dev->ports[SAA7164_PORT_TS2];
else
BUG();
return -EINVAL; /* should not happen */
fe = tsport->dvb.frontend;