Explanation on Uninitialized Variable bio in blk_rq_prep_clone

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

 



Explaination of how bio could be used uninitialized in this function:

In the function blk_rq_prep_clone, the variable bio is declared but can remain uninitialized 
if the allocation with bio_alloc_clone fails. This can lead to undefined behavior when the 
function attempts to free bio in the error handling section using bio_put(bio). 
By initializing bio to NULL at declaration, we ensure that the cleanup code will only 
interact with bio if it has been successfully allocated.

Best regards,
Suraj Sonawane




[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