disk/cryptodisk: Add missing error check.
Found by: Coverity scan.
This commit is contained in:
parent
2a8200bba8
commit
4c7337bfe9
1 changed files with 6 additions and 4 deletions
|
@ -372,11 +372,13 @@ grub_cryptodisk_endecrypt (struct grub_cryptodisk *dev,
|
||||||
break;
|
break;
|
||||||
case GRUB_CRYPTODISK_MODE_ECB:
|
case GRUB_CRYPTODISK_MODE_ECB:
|
||||||
if (do_encrypt)
|
if (do_encrypt)
|
||||||
grub_crypto_ecb_encrypt (dev->cipher, data + i, data + i,
|
err = grub_crypto_ecb_encrypt (dev->cipher, data + i, data + i,
|
||||||
(1U << dev->log_sector_size));
|
(1U << dev->log_sector_size));
|
||||||
else
|
else
|
||||||
grub_crypto_ecb_decrypt (dev->cipher, data + i, data + i,
|
err = grub_crypto_ecb_decrypt (dev->cipher, data + i, data + i,
|
||||||
(1U << dev->log_sector_size));
|
(1U << dev->log_sector_size));
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return GPG_ERR_NOT_IMPLEMENTED;
|
return GPG_ERR_NOT_IMPLEMENTED;
|
||||||
|
|
Loading…
Reference in a new issue