[PATCH] block-throttle: set q->td to NULL if blkcg_activate_policy failed

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

 



Otherwise q->td will point to the released memory, although there is
no access to q->td in the following process, still recommend to do this.

Signed-off-by: Zheng Bin <zhengbin13@xxxxxxxxxx>
---
 block/blk-throttle.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index fee3325edf27..05b87516eee9 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -2399,6 +2399,7 @@ int blk_throtl_init(struct request_queue *q)
 		free_percpu(td->latency_buckets[READ]);
 		free_percpu(td->latency_buckets[WRITE]);
 		kfree(td);
+		q->td = NULL;
 	}
 	return ret;
 }
--
2.25.4




[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