]> git.baikalelectronics.ru Git - kernel.git/commit
staging/lustre/ptlrpc: Fix potential NULL pointer dereference
authorOleg Drokin <green@linuxhacker.ru>
Sat, 16 May 2015 07:38:33 +0000 (03:38 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 00:29:45 +0000 (09:29 +0900)
commite232e0bc6f30921d13f1f18b32aafe3b2f0afb24
treecf65885acf89c73380d6a0ff85163b268250fb2f
parent1c1583b7f278340be7713c372c56071b422370c1
staging/lustre/ptlrpc: Fix potential NULL pointer dereference

In lov_unpackmd() there's this strange bit of code where we first try
to look inside of lmm striping pattern for it's type, and then
we check if the pattern is NULL which cannot be right.
Move the check under if (lmm) branch so that it's safe.

Found by Coverity version 6.6.1

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-on: http://review.whamcloud.com/7827
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4049
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Signed-off: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lov/lov_pack.c