[bug report] crypto: omap-aes - Add support for GCM mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Tero Kristo,

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

The patch ad18cc9d0f91: "crypto: omap-aes - Add support for GCM mode" 
from May 24, 2017, leads to the following Smatch complaint:

    drivers/crypto/omap-aes.c:1262 omap_aes_probe()
     error: we previously assumed 'dd->pdata->aead_algs_info' could be null (see line 1237)

drivers/crypto/omap-aes.c
  1236	
  1237		if (dd->pdata->aead_algs_info &&
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
This check could presumably be removed?

  1238		    !dd->pdata->aead_algs_info->registered) {
  1239			for (i = 0; i < dd->pdata->aead_algs_info->size; i++) {
  1240				aalg = &dd->pdata->aead_algs_info->algs_list[i];
  1241				algp = &aalg->base;
  1242	
  1243				pr_debug("reg alg: %s\n", algp->cra_name);
  1244				INIT_LIST_HEAD(&algp->cra_list);
  1245	
  1246				err = crypto_register_aead(aalg);
  1247				if (err)
  1248					goto err_aead_algs;
  1249	
  1250				dd->pdata->aead_algs_info->registered++;
  1251			}
  1252		}
  1253	
  1254		err = sysfs_create_group(&dev->kobj, &omap_aes_attr_group);
  1255		if (err) {
  1256			dev_err(dev, "could not create sysfs device attrs\n");
  1257			goto err_aead_algs;
  1258		}
  1259	
  1260		return 0;
  1261	err_aead_algs:
  1262		for (i = dd->pdata->aead_algs_info->registered - 1; i >= 0; i--) {
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Otherwise the error handling needs a check as well.

  1263			aalg = &dd->pdata->aead_algs_info->algs_list[i];
  1264			crypto_unregister_aead(aalg);

regards,
dan carpenter



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux