diff options
author | Shaohua Li <shli@fb.com> | 2016-08-23 04:14:01 (GMT) |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-08-24 17:21:52 (GMT) |
commit | 5f9d1fde7d54a5d5fd8cccbee9c9c31474fcdcf2 (patch) | |
tree | 928efbe6ba6efef4e84eed37103038015770614a /drivers/regulator/rn5t618-regulator.c | |
parent | 27028626b4b9022dcac23688e09ea43b36e1183c (diff) | |
download | linux-5f9d1fde7d54a5d5fd8cccbee9c9c31474fcdcf2.tar.xz |
raid5: fix memory leak of bio integrity data
Yi reported a memory leak of raid5 with DIF/DIX enabled disks. raid5
doesn't alloc/free bio, instead it reuses bios. There are two issues in
current code:
1. the code calls bio_init (from
init_stripe->raid5_build_block->bio_init) then bio_reset (ops_run_io).
The bio is reused, so likely there is integrity data attached. bio_init
will clear a pointer to integrity data and makes bio_reset can't release
the data
2. bio_reset is called before dispatching bio. After bio is finished,
it's possible we don't free bio's integrity data (eg, we don't call
bio_reset again)
Both issues will cause memory leak. The patch moves bio_init to stripe
creation and bio_reset to bio end io. This will fix the two issues.
Reported-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/regulator/rn5t618-regulator.c')
0 files changed, 0 insertions, 0 deletions