Skip to content

Commit 74ef241

Browse files
eunovmgregkh
authored andcommitted
media: st-hva: Fix potential NULL pointer dereferences
[ Upstream commit b7fdd20 ] When ctx_id >= HVA_MAX_INSTANCES in hva_hw_its_irq_thread() it tries to access fields of ctx that is NULL at that point. The patch gets rid of these accesses. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov <novikov@ispras.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 617afce commit 74ef241

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/media/platform/sti/hva/hva-hw.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ static irqreturn_t hva_hw_its_irq_thread(int irq, void *arg)
130130
ctx_id = (hva->sts_reg & 0xFF00) >> 8;
131131
if (ctx_id >= HVA_MAX_INSTANCES) {
132132
dev_err(dev, "%s %s: bad context identifier: %d\n",
133-
ctx->name, __func__, ctx_id);
134-
ctx->hw_err = true;
133+
HVA_PREFIX, __func__, ctx_id);
135134
goto out;
136135
}
137136

0 commit comments

Comments
 (0)