media: ngene: Add dvb_ca_en50221_init return value check

The return value of dvb_ca_en50221_init() is not checked here that may
cause undefined behavior in case of nonzero value return.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 25aee3debe ("[media] Rename media/dvb as media/pci")
Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
Aleksandr Burakov 2024-03-01 14:15:53 +03:00 committed by Hans Verkuil
parent 3c2ea5ec1d
commit 9bb1fd7edd

View File

@ -1488,7 +1488,9 @@ static int init_channel(struct ngene_channel *chan)
} }
if (dev->ci.en && (io & NGENE_IO_TSOUT)) { if (dev->ci.en && (io & NGENE_IO_TSOUT)) {
dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1); ret = dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1);
if (ret != 0)
goto err;
set_transfer(chan, 1); set_transfer(chan, 1);
chan->dev->channel[2].DataFormatFlags = DF_SWAP32; chan->dev->channel[2].DataFormatFlags = DF_SWAP32;
set_transfer(&chan->dev->channel[2], 1); set_transfer(&chan->dev->channel[2], 1);