staging: iio: light: cm3218: Fix error paths
authorSri Krishna chowdary <schowdary@nvidia.com>
Fri, 5 Jul 2013 10:59:56 +0000 (15:59 +0530)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 20:18:37 +0000 (13:18 -0700)
commit710d60e3532f04aba396e524f3c80025564d221c
tree25a2fc9d0eca8715131efd9a2fa81279e75bb082
parentacd1b2de165e96051cb2a71396a550772e37d95a
staging: iio: light: cm3218: Fix error paths

1. if regulator is not found then chip->consumers is null.
Prevent Null dereference by adding check.
2. Add proper exit states in case of error in probe
3. Assign chip->id during probe

Bug 1256462
Bug 1327616

Change-Id: I0cf7ff6f1071a50886a31867f7ab68652ed06535
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/245356
(cherry picked from commit 2f14b527f78d01d40b55a61cb25fe6cad9857097)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/264212
Reviewed-by: Automatic_Commit_Validation_User
drivers/staging/iio/light/cm3218.c