dm stats: fix divide by zero if 'number_of_areas' arg is zero
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 5 Jun 2015 13:50:42 +0000 (09:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:55 +0000 (09:29 -0700)
commitd90be37ead9f3a9a7a254e9eb8b56d7e82d3d0b5
treedb38ba1f6fcc16258fb893665e58473cda400a84
parent9d5feb50069fd51462440359c65aa27321f606eb
dm stats: fix divide by zero if 'number_of_areas' arg is zero

commit dd4c1b7d0c95be1c9245118a3accc41a16f1db67 upstream.

If the number_of_areas argument was zero the kernel would crash on
div-by-zero.  Add better input validation.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-stats.c