Return -ENOMEM instead of -ENODEV when kzalloc_obj() fails in
wf_ad7417_probe().
Fixes: 850dc32168a9 ("powerpc/windfarm: Add ad7417 sensor")
Signed-off-by: Thorsten Blum <[email protected]>
---
drivers/macintosh/windfarm_ad7417_sensor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/macintosh/windfarm_ad7417_sensor.c
b/drivers/macintosh/windfarm_ad7417_sensor.c
index 4bae07ca6669..ed91e5bdee76 100644
--- a/drivers/macintosh/windfarm_ad7417_sensor.c
+++ b/drivers/macintosh/windfarm_ad7417_sensor.c
@@ -262,7 +262,7 @@ static int wf_ad7417_probe(struct i2c_client *client)
pv = kzalloc_obj(struct wf_ad7417_priv);
if (pv == NULL)
- return -ENODEV;
+ return -ENOMEM;
kref_init(&pv->ref);
mutex_init(&pv->lock);