summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorSuresh Udipi2019-04-24 21:23:43 +0200
committerGreg Kroah-Hartman2019-05-10 17:54:05 +0200
commit34ae4c6a3609960d4fc4010df7a4b2b877649d00 (patch)
treeb611e1fb49848944afcf50852b5b62c883f623eb /drivers/staging
parentstaging: greybus: power_supply: fix prop-descriptor request size (diff)
downloadkernel-qcow2-linux-34ae4c6a3609960d4fc4010df7a4b2b877649d00.tar.gz
kernel-qcow2-linux-34ae4c6a3609960d4fc4010df7a4b2b877649d00.tar.xz
kernel-qcow2-linux-34ae4c6a3609960d4fc4010df7a4b2b877649d00.zip
staging: most: cdev: fix chrdev_region leak in mod_exit
commit af708900e9a48c0aa46070c8a8cdf0608a1d2025 upstream. It looks like v4.18-rc1 commit [0] which upstreams mld-1.8.0 commit [1] missed to fix the memory leak in mod_exit function. Do it now. [0] aba258b7310167 ("staging: most: cdev: fix chrdev_region leak") [1] https://github.com/microchip-ais/linux/commit/a2d8f7ae7ea381 ("staging: most: cdev: fix leak for chrdev_region") Signed-off-by: Suresh Udipi <sudipi@jp.adit-jv.com> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Acked-by: Christian Gromm <christian.gromm@microchip.com> Fixes: aba258b73101 ("staging: most: cdev: fix chrdev_region leak") Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/most/cdev/cdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/most/cdev/cdev.c b/drivers/staging/most/cdev/cdev.c
index 4569838f27a0..0b48677fa958 100644
--- a/drivers/staging/most/cdev/cdev.c
+++ b/drivers/staging/most/cdev/cdev.c
@@ -546,7 +546,7 @@ static void __exit mod_exit(void)
destroy_cdev(c);
destroy_channel(c);
}
- unregister_chrdev_region(comp.devno, 1);
+ unregister_chrdev_region(comp.devno, CHRDEV_REGION_SIZE);
ida_destroy(&comp.minor_id);
class_destroy(comp.class);
}