Input: synaptics-rmi4 - fix error return code in rmi_probe_interrupts()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 7 Feb 2017 18:00:37 +0000 (10:00 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 7 Feb 2017 22:23:43 +0000 (14:23 -0800)
Fix to return error code -ENOMEM from the devm_kzalloc() error handling
case instead of 0, as done elsewhere in this function.

Fixes: 6bd0dcfacf28 ("Input: synaptics-rmi4 - factor out functions
from probe")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/rmi4/rmi_driver.c

index 2aa3cd0fe222b832a9656c0d71a5641eef5fa4af..746255830b4743e5c79753b73f9661b03188f08c 100644 (file)
@@ -1062,7 +1062,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
        data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL);
        if (!data->irq_memory) {
                dev_err(dev, "Failed to allocate memory for irq masks.\n");
-               return retval;
+               return -ENOMEM;
        }
 
        data->irq_status        = data->irq_memory + size * 0;