]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
i2c: qup: disable clks and return instead of just returning error
authorPramod Gurav <pramod.gurav@smartplayin.com>
Wed, 6 Aug 2014 12:33:25 +0000 (18:03 +0530)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 6 Aug 2014 18:50:44 +0000 (20:50 +0200)
This fixes a error handling scenario where clocks were not being disabled
when QUP_OUTPUT_BLOCK_SIZE returns a size greater than the size of blk_sizes
array. So this patch adds a statement to jump to the fail lable to release the
clocks.

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-qup.c

index 2a5efb5b487cdc2e4fb8774e94167f6af53ca7d8..3a4d64e1dfb16fe78013954f4441a93edb00c605 100644 (file)
@@ -633,13 +633,17 @@ static int qup_i2c_probe(struct platform_device *pdev)
         * associated with each byte written/received
         */
        size = QUP_OUTPUT_BLOCK_SIZE(io_mode);
-       if (size >= ARRAY_SIZE(blk_sizes))
-               return -EIO;
+       if (size >= ARRAY_SIZE(blk_sizes)) {
+               ret = -EIO;
+               goto fail;
+       }
        qup->out_blk_sz = blk_sizes[size] / 2;
 
        size = QUP_INPUT_BLOCK_SIZE(io_mode);
-       if (size >= ARRAY_SIZE(blk_sizes))
-               return -EIO;
+       if (size >= ARRAY_SIZE(blk_sizes)) {
+               ret = -EIO;
+               goto fail;
+       }
        qup->in_blk_sz = blk_sizes[size] / 2;
 
        size = QUP_OUTPUT_FIFO_SIZE(io_mode);