Browse Source

char: xilinx_hwicap: missing error code if ioremap() fails

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>
Dan Carpenter 11 years ago
parent
commit
8a26af30ff
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/char/xilinx_hwicap/xilinx_hwicap.c

+ 1 - 0
drivers/char/xilinx_hwicap/xilinx_hwicap.c

@@ -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;
 	}