OSDN Git Service

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)
committerMike Snitzer <snitzer@redhat.com>
Wed, 17 Jun 2015 16:40:39 +0000 (12:40 -0400)
commitdd4c1b7d0c95be1c9245118a3accc41a16f1db67
tree3f2ba6693d124977cd18155d132f52a1de20c9b2
parentbccab6a01afc26f53d91762d78153513cad10b29
dm stats: fix divide by zero if 'number_of_areas' arg is zero

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>
Cc: stable@vger.kernel.org # v3.12+
drivers/md/dm-stats.c