[RFC PATCH 15/20] loop: remove memset in loop_info64_from_old()

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

 



In current code loop_info64_from_old() is only called from the one
caller loop_set_status_old(). Initialize the info64 local variable to
zero before we pass it to the loop_info64_from_old() so that we can get
rid of the memset in the loop_info64_from_old().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
 drivers/block/loop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 2029ca399ea3..62f622791fb5 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1460,7 +1460,6 @@ static int loop_get_status(struct loop_device *lo,
 static void loop_info64_from_old(const struct loop_info *info,
 				 struct loop_info64 *info64)
 {
-	memset(info64, 0, sizeof(*info64));
 	info64->lo_number = info->lo_number;
 	info64->lo_device = info->lo_device;
 	info64->lo_inode = info->lo_inode;
@@ -1513,7 +1512,7 @@ static int loop_set_status_old(struct loop_device *lo,
 			       const struct loop_info __user *arg)
 {
 	struct loop_info info;
-	struct loop_info64 info64;
+	struct loop_info64 info64 = { };
 
 	if (copy_from_user(&info, arg, sizeof (struct loop_info)))
 		return -EFAULT;
-- 
2.22.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux