char: xilinx_hwicap: missing error code if ioremap() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Jun 2014 06:04:33 +0000 (09:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 23:59:58 +0000 (16:59 -0700)
Return -ENOMEM instead of success if ioremap() fails.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/xilinx_hwicap/xilinx_hwicap.c

index f6345f932e46c8e841ae2f7e9777da0ed9a905f3..9b1a5ac4881df4292d950c9eba8e341f4de3fced 100644 (file)
@@ -661,6 +661,7 @@ static int hwicap_setup(struct device *dev, int id,
        drvdata->base_address = ioremap(drvdata->mem_start, drvdata->mem_size);
        if (!drvdata->base_address) {
                dev_err(dev, "ioremap() failed\n");
+               retval = -ENOMEM;
                goto failed2;
        }