[kbuild] [digsig:dm-integrity 1/4] drivers/md/dm-integrity.c:431 dm_int_verify_io() warn: passing the wrong stuff kunmap()

2014-02-26 Thread kbuild test robot
TO: Dmitry Kasatkin d.kasat...@samsung.com


Hi Dmitry,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/kasatkin/linux-digsig.git 
dm-integrity
head:   6fb61adc51796f1379c3b1432340c67d82c794e2
commit: 883e383ea2a3c0c7bdc78f21a6c65ec9b65342ec [1/4] dm-integrity: integrity 
protection device-mapper target
:: branch date: 75 minutes ago
:: commit date: 75 minutes ago

drivers/md/dm-integrity.c:431 dm_int_verify_io() warn: passing the wrong stuff 
kunmap()

git remote add digsig 
git://git.kernel.org/pub/scm/linux/kernel/git/kasatkin/linux-digsig.git
git remote update digsig
git checkout 883e383ea2a3c0c7bdc78f21a6c65ec9b65342ec
vim +431 drivers/md/dm-integrity.c

883e383e Dmitry Kasatkin 2013-10-23  415if (err)
883e383e Dmitry Kasatkin 2013-10-23  416break;
883e383e Dmitry Kasatkin 2013-10-23  417  
883e383e Dmitry Kasatkin 2013-10-23  418err = 
dm_int_calc_hmac(io, offset, digest, sizeof(digest),
883e383e Dmitry Kasatkin 2013-10-23  419   
hmac);
883e383e Dmitry Kasatkin 2013-10-23  420if (err)
883e383e Dmitry Kasatkin 2013-10-23  421break;
883e383e Dmitry Kasatkin 2013-10-23  422  
883e383e Dmitry Kasatkin 2013-10-23  423err = 
dm_int_verify_hmac(io, offset, hmac, bio_data_dir(bio));
883e383e Dmitry Kasatkin 2013-10-23  424if (err) {
883e383e Dmitry Kasatkin 2013-10-23  425if (dmi-flags 
 DM_INT_FLAGS_ZERO) {
883e383e Dmitry Kasatkin 2013-10-23  426void 
*ptr = kmap(bv-bv_page);
883e383e Dmitry Kasatkin 2013-10-23  427if 
(!ptr)
883e383e Dmitry Kasatkin 2013-10-23  428
break;
883e383e Dmitry Kasatkin 2013-10-23  429
DMERR_LIMIT(Ignoring bad HMAC);
883e383e Dmitry Kasatkin 2013-10-23  430
memset(ptr + bv-bv_offset, 0, bv-bv_len);
883e383e Dmitry Kasatkin 2013-10-23 @431
kunmap(ptr);
883e383e Dmitry Kasatkin 2013-10-23  432err = 0;
883e383e Dmitry Kasatkin 2013-10-23  433} else
883e383e Dmitry Kasatkin 2013-10-23  434break;
883e383e Dmitry Kasatkin 2013-10-23  435}
883e383e Dmitry Kasatkin 2013-10-23  436  
883e383e Dmitry Kasatkin 2013-10-23  437offset += bv-bv_len;
883e383e Dmitry Kasatkin 2013-10-23  438size -= bv-bv_len;
883e383e Dmitry Kasatkin 2013-10-23  439}

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [digsig:dm-integrity 1/4] drivers/md/dm-integrity.c:431 dm_int_verify_io() warn: passing the wrong stuff kunmap()

2014-02-26 Thread Dan Carpenter
[ The error message has bad grammar and is confusing.  It means that it
  should be kunmap(bv-bv_page) - dan]

Hi Dmitry,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/kasatkin/linux-digsig.git 
dm-integrity
head:   6fb61adc51796f1379c3b1432340c67d82c794e2
commit: 883e383ea2a3c0c7bdc78f21a6c65ec9b65342ec [1/4] dm-integrity: integrity 
protection device-mapper target

drivers/md/dm-integrity.c:431 dm_int_verify_io() warn: passing the wrong stuff 
kunmap()

git remote add digsig 
git://git.kernel.org/pub/scm/linux/kernel/git/kasatkin/linux-digsig.git
git remote update digsig
git checkout 883e383ea2a3c0c7bdc78f21a6c65ec9b65342ec
vim +431 drivers/md/dm-integrity.c

883e383e Dmitry Kasatkin 2013-10-23  415if (err)
883e383e Dmitry Kasatkin 2013-10-23  416break;
883e383e Dmitry Kasatkin 2013-10-23  417  
883e383e Dmitry Kasatkin 2013-10-23  418err = 
dm_int_calc_hmac(io, offset, digest, sizeof(digest),
883e383e Dmitry Kasatkin 2013-10-23  419   
hmac);
883e383e Dmitry Kasatkin 2013-10-23  420if (err)
883e383e Dmitry Kasatkin 2013-10-23  421break;
883e383e Dmitry Kasatkin 2013-10-23  422  
883e383e Dmitry Kasatkin 2013-10-23  423err = 
dm_int_verify_hmac(io, offset, hmac, bio_data_dir(bio));
883e383e Dmitry Kasatkin 2013-10-23  424if (err) {
883e383e Dmitry Kasatkin 2013-10-23  425if (dmi-flags 
 DM_INT_FLAGS_ZERO) {
883e383e Dmitry Kasatkin 2013-10-23  426void 
*ptr = kmap(bv-bv_page);
883e383e Dmitry Kasatkin 2013-10-23  427if 
(!ptr)
883e383e Dmitry Kasatkin 2013-10-23  428
break;
883e383e Dmitry Kasatkin 2013-10-23  429
DMERR_LIMIT(Ignoring bad HMAC);
883e383e Dmitry Kasatkin 2013-10-23  430
memset(ptr + bv-bv_offset, 0, bv-bv_len);
883e383e Dmitry Kasatkin 2013-10-23 @431
kunmap(ptr);
883e383e Dmitry Kasatkin 2013-10-23  432err = 0;
883e383e Dmitry Kasatkin 2013-10-23  433} else
883e383e Dmitry Kasatkin 2013-10-23  434break;
883e383e Dmitry Kasatkin 2013-10-23  435}
883e383e Dmitry Kasatkin 2013-10-23  436  
883e383e Dmitry Kasatkin 2013-10-23  437offset += bv-bv_len;
883e383e Dmitry Kasatkin 2013-10-23  438size -= bv-bv_len;
883e383e Dmitry Kasatkin 2013-10-23  439}

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild