Return -ENOMEM instead of -ENODEV when kzalloc_obj() fails in
wf_lm75_probe().

Fixes: 351ca3e31197 ("windfarm: Convert to new-style i2c drivers")
Signed-off-by: Thorsten Blum <[email protected]>
---
 drivers/macintosh/windfarm_lm75_sensor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/macintosh/windfarm_lm75_sensor.c 
b/drivers/macintosh/windfarm_lm75_sensor.c
index 128e9944429a..ad74182242d8 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -132,7 +132,7 @@ static int wf_lm75_probe(struct i2c_client *client)
 
        lm = kzalloc_obj(struct wf_lm75_sensor);
        if (lm == NULL)
-               return -ENODEV;
+               return -ENOMEM;
 
        lm->inited = 0;
        lm->ds1775 = ds1775;

Reply via email to