Skip to content
Commit 682f560b authored by Dan Carpenter's avatar Dan Carpenter Committed by Paolo Abeni
Browse files

net: microchip: sparx5: Fix error handling in vcap_show_admin()

If vcap_dup_rule() fails that leads to an error pointer dereference
side the call to vcap_free_rule().  Also it only returns an error if the
very last call to vcap_read_rule() fails and it returns success for
other errors.

I've changed it to just stop printing after the first error and return
an error code.

Fixes: 3a792156

 ("net: microchip: sparx5: Add VCAP rule debugFS support for the VCAP API")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarSteen Hegelund <Steen.Hegelund@microchip.com>
Link: https://lore.kernel.org/r/Y4XUUx9kzurBN+BV@kili
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent e5214f36
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment