crypto: omap-sham - potential Oops on error in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 18 May 2016 10:39:05 +0000 (13:39 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 19 May 2016 10:03:00 +0000 (18:03 +0800)
This if statement is reversed so we end up either leaking or Oopsing on
error.

Fixes: dbe246209bc1 ('crypto: omap-sham - Use dma_request_chan() for requesting DMA channel')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-sham.c

index 6eefaa2fe58f990ce39ca1d7c7078a3d65eeafa6..63464e86f2b1bdd77d115132933e5cbfbc20ecc9 100644 (file)
@@ -1986,7 +1986,7 @@ err_algs:
                                        &dd->pdata->algs_info[i].algs_list[j]);
 err_pm:
        pm_runtime_disable(dev);
-       if (dd->polling_mode)
+       if (!dd->polling_mode)
                dma_release_channel(dd->dma_lch);
 data_err:
        dev_err(dev, "initialization failed.\n");