Re: [PATCH V3 2/6] block: add centralize REQ_OP_XXX to string helper

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

 



On 6/17/19 10:42 PM, Chaitanya Kulkarni wrote:
+inline const char *blk_op_str(int op)
+{
+	const char *op_str = "UNKNOWN";
+
+	if (op < ARRAY_SIZE(blk_op_name) && blk_op_name[op])
+		op_str = blk_op_name[op];
+
+	return op_str;
+}

This won't work correctly if op < 0. If you have another look at the block layer debugfs code you will see that 'op' is has an unsigned type in that code. Please either change the type of 'op' from 'int' to 'unsigned int' or change 'op < ARRAY_SIZE(blk_op_name)' into '(unsigned)op < ARRAY_SIZE(blk_op_name)'.

Thanks,

Bart.



[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