Skip to contentSkip to conversation

crypto: omap-sham - add support functions for sg based data handling

bug report Dan Carpenter 1 participant 1 message Oct 13, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

Hello Tero Kristo,

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

The patch f19de1bc67a0: "crypto: omap-sham - add support functions for sg based data handling" from Sep 19, 2016, leads to the following Smatch complaint:

drivers/crypto/omap-sham.c:808 omap_sham_prepare_request()
warn: variable dereferenced before check 'req' (see line 801)

drivers/crypto/omap-sham.c
800 {

   801		struct omap_sham_reqctx *rctx = ahash_request_ctx(req);
                                                                  ^^^

New dereference inside function.

802 int bs;
803 int ret;
804 int nbytes;
805 bool final = rctx->flags & BIT(FLAGS_FINUP);
806 int xmit_len, hash_later;
807
808 if (!req)

                    ^^^^

New check is too late.

809 return 0;
810

regards,
dan carpenter