Skip to contentSkip to conversation

crypto: omap-sham - potential Oops on error in probe

PATCH In review Dan Carpenter 3 participants 5 messages May 18, 2016 – May 19, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: omap-sham - potential Oops on error in probe

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')
drivers/crypto/omap-sham.c +1 -1
index 6eefaa2..63464e8 100644
@@ -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");
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Dan Carpenter

This if statement is reversed so we end up either leaking or Oopsing on error.

Oops, sorry for that.
Probably the other omap-* crypto drivers have the same issue? Can you send a patch for them or should I do it?

Quoted 17 lines
Fixes dbe246209bc1 ('crypto: omap-sham - Use dma_request_chan() for requesting DMA channel')
drivers/crypto/omap-sham.c +1 -1
index 6eefaa2..63464e8 100644
@@ -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");
Signature · 5 lines
Péter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 7 lines · Peter Ujfalusi
Quoted 2 lines · Dan Carpenter

This if statement is reversed so we end up either leaking or Oopsing on error.

Oops, sorry for that.
Probably the other omap-* crypto drivers have the same issue? Can you send a patch for them or should I do it?

I didn't see those static checker warnings so probably it means I can't compile the drivers. Could you do it?

regards,
dan carpenter

#3 lore raw
Quoted 11 lines · Dan Carpenter
Quoted 7 lines · Peter Ujfalusi
Quoted 2 lines · Dan Carpenter

This if statement is reversed so we end up either leaking or Oopsing on error.

Oops, sorry for that.
Probably the other omap-* crypto drivers have the same issue? Can you send a patch for them or should I do it?

I didn't see those static checker warnings so probably it means I can't compile the drivers. Could you do it?

I have taken a look at omap-aes and omap-des. They are OK.

Signature · 5 lines
Péter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#4 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

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')

Patch applied. Thanks!

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt