Skip to content

Commit

Permalink
media: dmxdev: change the check for problems allocing secfeed
Browse files Browse the repository at this point in the history
While the logic there is right, it tricks static check analyzers,
like smatch:

	drivers/media/dvb-core/dmxdev.c:729 dvb_dmxdev_filter_start() error: we previously assumed '*secfeed' could be null (see line 719)

Because the implementation of the filter itself is made via
a callback, with its real implementation at the
dvbdmx_allocate_section_feed() inside dvb_demux.c.

So, change the check logic to make it clear that the function
will not try to use *secfeed == NULL.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Mauro Carvalho Chehab committed Jun 9, 2021
1 parent 45040f6 commit 3d42c93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb-core/dmxdev.c
Original file line number Diff line number Diff line change
@@ -720,7 +720,7 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter)
ret = dmxdev->demux->allocate_section_feed(dmxdev->demux,
secfeed,
dvb_dmxdev_section_callback);
if (ret < 0) {
if (!*secfeed) {
pr_err("DVB (%s): could not alloc feed\n",
__func__);
return ret;

0 comments on commit 3d42c93

Please sign in to comment.