pcm: dshare - fix shared memory pointer check

GitHub pull_request - opened github at alsa-project.org
Sun Mar 21 12:04:39 CET 2021


alsa-project/alsa-lib pull request #128 was opened from VanithaChannaiah:

Currently shared memory pointer is initialized to 0 and set to -1
in some, but not in all error paths.
In cleanup path of open the shm pointer is only compared to be non-NULL
before dereferencing it which leads to SEGFAULT in case it was set to -1.

This patch initializes pointer to -1 to have a unique identification
for invalid pointer and also checks for pointer being not -1 on
access in cleanup path.

Signed-off-by: Vanitha Channaiah <vanitha.channaiah at in.bosch.com>

Request URL   : https://github.com/alsa-project/alsa-lib/pull/128
Patch URL     : https://github.com/alsa-project/alsa-lib/pull/128.patch
Repository URL: https://github.com/alsa-project/alsa-lib


More information about the Alsa-devel mailing list