Skip to contentSkip to conversation

fscrypt: remove redundant assignment of res

PATCH Applied Colin King 2 participants 2 messages Jan 10, 2017 – Feb 7, 2017

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 fscrypt: remove redundant assignment of res

From: Colin Ian King <[email protected]>

res is assigned to sizeof(ctx), however, this is unused and res is updated later on without that assigned value to res ever being used. Remove this redundant assignment.

Fixes CoverityScan CID#1395546 "Unused value"

---
 fs/crypto/keyinfo.c | 1 -
 1 file changed, 1 deletion(-)
fs/crypto/keyinfo.c +0 -1
index eeb6fd67..02eb6b9 100644
@@ -211,7 +211,6 @@ int fscrypt_get_crypt_info(struct inode *inode)
 		ctx.contents_encryption_mode = FS_ENCRYPTION_MODE_AES_256_XTS;
 		ctx.filenames_encryption_mode = FS_ENCRYPTION_MODE_AES_256_CTS;
 		memset(ctx.master_key_descriptor, 0x42, FS_KEY_DESCRIPTOR_SIZE);
-		res = sizeof(ctx);
 	} else if (res != sizeof(ctx)) {
 		return -EINVAL;
 	}
Signature · 1 line
2.10.2
maintainer Applied
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

res is assigned to sizeof(ctx), however, this is unused and res is updated later on without that assigned value to res ever being used. Remove this redundant assignment.

Fixes CoverityScan CID#1395546 "Unused value"

Thanks, applied.

- Ted