diff options
author | Maurizio Lombardi <mlombard@redhat.com> | 2015-11-18 15:32:44 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2015-11-19 12:12:42 -0500 |
commit | ab08ee14393724ab52b92be643d588d41a1a05be (patch) | |
tree | 4d3f3d7c38ad4f9d178a2c15abedb84480ecdcb0 /include/sound/pcm.h | |
parent | a35bb4458e5e5c9dc19a0daa0629409285f3b25e (diff) | |
download | op-kernel-dev-ab08ee14393724ab52b92be643d588d41a1a05be.zip op-kernel-dev-ab08ee14393724ab52b92be643d588d41a1a05be.tar.gz |
st: fix potential null pointer dereference.
If cdev_add() returns an error, the code calls
cdev_del() passing the STm->cdevs[rew] pointer as parameter;
the problem is that the pointer has not been initialized yet.
This patch fixes the problem by moving the STm->cdevs[rew] pointer
initialization before the call to cdev_add().
It also sets STm->devs[rew] and STm->cdevs[rew] to NULL in
case of failure.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/sound/pcm.h')
0 files changed, 0 insertions, 0 deletions