block: Close luks and remove block device 47/162447/1
authorpr.jung <pr.jung@samsung.com>
Thu, 30 Nov 2017 07:23:48 +0000 (16:23 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 1 Dec 2017 09:19:28 +0000 (09:19 +0000)
- Remove operation frees bdev structure

Change-Id: I138310ea793261cd0163472820eaf0abda7b1df2
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/block/block.c

index 25cb70c..94b3f1d 100644 (file)
@@ -2325,15 +2325,15 @@ static int remove_block_device(struct udev_device *dev, const char *devnode)
                                return ret;
                        }
 
-                       ret = add_operation(bdev_extended, BLOCK_DEV_REMOVE, NULL, NULL);
+                       ret = add_operation(bdev_extended, BLOCK_LUKS_CLOSE, NULL, NULL);
                        if (ret < 0) {
-                               _E("Failed to add operation (remove %s)", devnode);
+                               _E("Failed to add operation (luks_close %s)", devnode);
                                return ret;
                        }
 
-                       ret = add_operation(bdev_extended, BLOCK_LUKS_CLOSE, NULL, NULL);
+                       ret = add_operation(bdev_extended, BLOCK_DEV_REMOVE, NULL, NULL);
                        if (ret < 0) {
-                               _E("Failed to add operation (luks_close %s)", devnode);
+                               _E("Failed to add operation (remove %s)", devnode);
                                return ret;
                        }
                } else