dm mpath: add checks for priority group count to avoid invalid memory access
authortang.junhui <tang.junhui@zte.com.cn>
Fri, 4 Nov 2016 04:37:09 +0000 (12:37 +0800)
committerMike Snitzer <snitzer@redhat.com>
Mon, 21 Nov 2016 14:52:08 +0000 (09:52 -0500)
commitcc5bd925f194c8dc7e2a4eee2c81a4f148018b08
tree4d8f3d715414945d7b462dd1e1824ddfa53989e8
parentf97dc421280e16b8eb0c8f685610ba007ec11b79
dm mpath: add checks for priority group count to avoid invalid memory access

This avoids the potential for invalid memory access, if/when there are
no priority groups, in response to invalid arguments being sent by the
user via DM message (e.g. "switch_group", "disable_group" or
"enable_group").

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-mpath.c