diff options
Diffstat (limited to 'fs/ecryptfs/crypto.c')
| -rw-r--r-- | fs/ecryptfs/crypto.c | 9 | 
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index a7b0c2dfb3d..d5c25db4398 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -301,17 +301,14 @@ int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg,  	while (size > 0 && i < sg_size) {  		pg = virt_to_page(addr);  		offset = offset_in_page(addr); -		if (sg) -			sg_set_page(&sg[i], pg, 0, offset); +		sg_set_page(&sg[i], pg, 0, offset);  		remainder_of_page = PAGE_CACHE_SIZE - offset;  		if (size >= remainder_of_page) { -			if (sg) -				sg[i].length = remainder_of_page; +			sg[i].length = remainder_of_page;  			addr += remainder_of_page;  			size -= remainder_of_page;  		} else { -			if (sg) -				sg[i].length = size; +			sg[i].length = size;  			addr += size;  			size = 0;  		}  |