dm stats: fix divide by zero if 'number_of_areas' arg is zero
commit83891b4cab7ee6cecc1050c533826f9b27c03270
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 5 Jun 2015 13:50:42 +0000 (5 09:50 -0400)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 4 Jul 2015 03:02:33 +0000 (3 23:02 -0400)
treeb6115d14db155d1fc13f1653c7a8b44a3fc4d7f8
parentc9fdda04b9041f8105e4308078a2519bc6928852
dm stats: fix divide by zero if 'number_of_areas' arg is zero

[ Upstream commit dd4c1b7d0c95be1c9245118a3accc41a16f1db67 ]

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+
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/md/dm-stats.c