staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_v...
authorzhengbin <zhengbin13@huawei.com>
Tue, 8 Oct 2019 07:41:50 +0000 (15:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Oct 2019 12:52:55 +0000 (14:52 +0200)
If vchi_msg_dequeue return -1, variable m is not assigined,
need to return.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1570520515-2186-2-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c

index 23fba01..6780b3f 100644 (file)
@@ -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);