提交 baed3c4b 编写于 作者: G Gustavo A. R. Silva 提交者: Mauro Carvalho Chehab

media: c8sectpfe: fix potential NULL pointer dereference in c8sectpfe_timer_interrupt

_channel_ is being dereferenced before it is null checked, hence there is a
potential null pointer dereference. Fix this by moving the pointer dereference
after _channel_ has been null checked.

This issue was detected with the help of Coccinelle.

Fixes: c5f5d0f9 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support")
Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: NPatrice Chotard <patrice.chotard@st.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 32f2fe59
...@@ -83,7 +83,7 @@ static void c8sectpfe_timer_interrupt(struct timer_list *t) ...@@ -83,7 +83,7 @@ static void c8sectpfe_timer_interrupt(struct timer_list *t)
static void channel_swdemux_tsklet(unsigned long data) static void channel_swdemux_tsklet(unsigned long data)
{ {
struct channel_info *channel = (struct channel_info *)data; struct channel_info *channel = (struct channel_info *)data;
struct c8sectpfei *fei = channel->fei; struct c8sectpfei *fei;
unsigned long wp, rp; unsigned long wp, rp;
int pos, num_packets, n, size; int pos, num_packets, n, size;
u8 *buf; u8 *buf;
...@@ -91,6 +91,8 @@ static void channel_swdemux_tsklet(unsigned long data) ...@@ -91,6 +91,8 @@ static void channel_swdemux_tsklet(unsigned long data)
if (unlikely(!channel || !channel->irec)) if (unlikely(!channel || !channel->irec))
return; return;
fei = channel->fei;
wp = readl(channel->irec + DMA_PRDS_BUSWP_TP(0)); wp = readl(channel->irec + DMA_PRDS_BUSWP_TP(0));
rp = readl(channel->irec + DMA_PRDS_BUSRP_TP(0)); rp = readl(channel->irec + DMA_PRDS_BUSRP_TP(0));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册