From: zhengbin Date: Tue, 8 Oct 2019 07:41:50 +0000 (+0800) Subject: staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_v... X-Git-Tag: v5.5-rc1~135^2~297 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=5193dbdaf0b07a46b6659c7a38c80c947f7ab732;p=linux.git staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_vchi_callback If vchi_msg_dequeue return -1, variable m is not assigined, need to return. Reported-by: Hulk Robot Signed-off-by: zhengbin Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/1570520515-2186-2-git-send-email-zhengbin13@huawei.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index 23fba01107b9..6780b3ff4fbb 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -103,6 +103,9 @@ static void audio_vchi_callback(void *param, status = vchi_msg_dequeue(instance->vchi_handle, &m, sizeof(m), &msg_len, VCHI_FLAGS_NONE); + if (status) + return; + if (m.type == VC_AUDIO_MSG_TYPE_RESULT) { instance->result = m.result.success; complete(&instance->msg_avail_comp);