linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver
@ 2017-11-08  8:46 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-11-08  8:46 UTC (permalink / raw)
  To: harsh; +Cc: linux-crypto

Hello Harsh Jain,

This is a semi-automatic email about new static checker warnings.

The patch 2f47d5804311: "crypto: chelsio - Move DMA un/mapping to
chcr from lld cxgb4 driver" from Oct 8, 2017, leads to the following
Smatch complaint:

    drivers/crypto/chelsio/chcr_algo.c:562 ulptx_walk_add_sg()
    error: we previously assumed 'sg' could be null (see line 551)

drivers/crypto/chelsio/chcr_algo.c
   550	
   551		while (sg && skip) {
                       ^^
The patch adds a new check for NULL

   552			if (sg_dma_len(sg) <= skip) {
   553				skip -= sg_dma_len(sg);
   554				skip_len = 0;
   555				sg = sg_next(sg);
   556			} else {
   557				skip_len = skip;
   558				skip = 0;
   559			}
   560		}
   561		if (walk->nents == 0) {
   562			small = min_t(unsigned int, sg_dma_len(sg) - skip_len, len);
                                                               ^^
This dereference (inside the macro) isn't checked.

   563			sgmin = min_t(unsigned int, small, CHCR_SRC_SG_SIZE);
   564			walk->sgl->len0 = cpu_to_be32(sgmin);

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-08  8:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08  8:46 [bug report] crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).