net: devlink: skip info_get op call if it is not defined in dumpit
authorJiri Pirko <jiri@mellanox.com>
Sat, 23 Mar 2019 23:21:03 +0000 (00:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Mar 2019 18:25:29 +0000 (11:25 -0700)
commitc493b09b2792336f471d2206be180a4b4c1fc9ba
tree7259781362e5ebbe450ffdd305347fdeeea3b655
parent450895d04ba13a96886eddfeddb11556ae8624f1
net: devlink: skip info_get op call if it is not defined in dumpit

In dumpit, unlike doit, the check for info_get op being defined
is missing. Add it and avoid null pointer dereference in case driver
does not define this op.

Fixes: f9cf22882c60 ("devlink: add device information API")
Reported-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c