]> git.baikalelectronics.ru Git - kernel.git/commit
staging: bcm2835-audio: replace null with error pointer value
authorAishwarya Pant <aishpant@gmail.com>
Sun, 12 Mar 2017 15:39:00 +0000 (21:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Mar 2017 23:57:53 +0000 (07:57 +0800)
commitbf958eac5a500985730400d16bc91cba37714146
tree59f52705fea6b196b0138b9aec7d326227100abe
parent246de1c3e0a79f48237e2806849d7848106c4e41
staging: bcm2835-audio: replace null with error pointer value

This patch replaces NULL values returned by vc_vchi_audio_init(...) with
error pointer values:
- Return ERR_PTR(-EINVAL) when too many instances of audio
  service are initialised
- Return ERR_PTR(-ENOMEM) when kzalloc fails
- RETURN ERR_PTR(-EPERM) when vchi connections fail to open

Similarly, a NULL check where vc_vchi_audio_init(...) is called is
replaced by IS_ERR(..)

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c