summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2026-07-13 21:25:21 +0200
committerMikulas Patocka <mpatocka@redhat.com>2026-07-13 21:32:48 +0200
commita02d51919b05a5b5b237012b3e6ea738bc533b08 (patch)
tree4542ea17a7fdbc2f3c7018d2f2aed1374a964e97 /drivers/md
parent553f9a9a36a600977f01bfbcc8139ce0ca419384 (diff)
downloadlinux-next-a02d51919b05a5b5b237012b3e6ea738bc533b08.tar.gz
linux-next-a02d51919b05a5b5b237012b3e6ea738bc533b08.zip
dm-ioctl: delete a useless condition
The condition "remaining <= 0" can never be true. The variable remaining has type size_t, thus it can't be negative. It can't be zero because we made sure earlier that "remaining > sizeof(struct dm_target_spec)" and then we added "sizeof(struct dm_target_spec)" to "outptr" (this means that we subtraceted "sizeof(struct dm_target_spec)" from "remaining"). Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Assisted-by: Claude:claude-opus-4.6
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-ioctl.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 61af2a437a05..d77e9971c28c 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1444,10 +1444,6 @@ static void retrieve_status(struct dm_table *table,
outptr += sizeof(struct dm_target_spec);
remaining = len - (outptr - outbuf);
- if (remaining <= 0) {
- param->flags |= DM_BUFFER_FULL_FLAG;
- break;
- }
/* Get the status/table string from the target driver */
if (ti->type->status) {