netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin()
@ 2023-09-08  7:03 Dan Carpenter
  2023-09-08  7:48 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2023-09-08  7:03 UTC (permalink / raw)
  To: Lars Povlsen, Horatiu Vultur
  Cc: Steen Hegelund, Daniel Machon, UNGLinuxDriver, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev,
	kernel-janitors

The vcap_decode_rule() never returns NULL.  There is no need to check
for that.  This code assumes that if it did return NULL we should
end abruptly and return success.  It is confusing.  Fix the check to
just be if (IS_ERR()) instead of if (IS_ERR_OR_NULL()).

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202309070831.hTvj9ekP-lkp@intel.com/
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
This bug is old, but it doesn't affect runtime so it should go to
net-next.

 drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
index c2c3397c5898..59bfbda29bb3 100644
--- a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
+++ b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
@@ -300,7 +300,7 @@ static int vcap_show_admin(struct vcap_control *vctrl,
 	vcap_show_admin_info(vctrl, admin, out);
 	list_for_each_entry(elem, &admin->rules, list) {
 		vrule = vcap_decode_rule(elem);
-		if (IS_ERR_OR_NULL(vrule)) {
+		if (IS_ERR(vrule)) {
 			ret = PTR_ERR(vrule);
 			break;
 		}
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin()
  2023-09-08  7:03 [PATCH net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin() Dan Carpenter
@ 2023-09-08  7:48 ` Simon Horman
  2023-09-08  8:27 ` Daniel Machon
  2023-10-03 14:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-09-08  7:48 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Lars Povlsen, Horatiu Vultur, Steen Hegelund, Daniel Machon,
	UNGLinuxDriver, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, kernel-janitors

On Fri, Sep 08, 2023 at 10:03:37AM +0300, Dan Carpenter wrote:
> The vcap_decode_rule() never returns NULL.  There is no need to check
> for that.  This code assumes that if it did return NULL we should
> end abruptly and return success.  It is confusing.  Fix the check to
> just be if (IS_ERR()) instead of if (IS_ERR_OR_NULL()).
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/r/202309070831.hTvj9ekP-lkp@intel.com/
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> This bug is old, but it doesn't affect runtime so it should go to
> net-next.

Reviewed-by: Simon Horman <horms@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin()
  2023-09-08  7:03 [PATCH net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin() Dan Carpenter
  2023-09-08  7:48 ` Simon Horman
@ 2023-09-08  8:27 ` Daniel Machon
  2023-10-03 14:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Machon @ 2023-09-08  8:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Lars Povlsen, Horatiu Vultur, Steen Hegelund, UNGLinuxDriver,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, kernel-janitors

> The vcap_decode_rule() never returns NULL.  There is no need to check
> for that.  This code assumes that if it did return NULL we should
> end abruptly and return success.  It is confusing.  Fix the check to
> just be if (IS_ERR()) instead of if (IS_ERR_OR_NULL()).
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/r/202309070831.hTvj9ekP-lkp@intel.com/
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> This bug is old, but it doesn't affect runtime so it should go to
> net-next.
> 

LGTM.

Thanks Dan!

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin()
  2023-09-08  7:03 [PATCH net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin() Dan Carpenter
  2023-09-08  7:48 ` Simon Horman
  2023-09-08  8:27 ` Daniel Machon
@ 2023-10-03 14:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-03 14:20 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: lars.povlsen, horatiu.vultur, Steen.Hegelund, daniel.machon,
	UNGLinuxDriver, davem, edumazet, kuba, pabeni, netdev,
	kernel-janitors

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 8 Sep 2023 10:03:37 +0300 you wrote:
> The vcap_decode_rule() never returns NULL.  There is no need to check
> for that.  This code assumes that if it did return NULL we should
> end abruptly and return success.  It is confusing.  Fix the check to
> just be if (IS_ERR()) instead of if (IS_ERR_OR_NULL()).
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/r/202309070831.hTvj9ekP-lkp@intel.com/
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> 
> [...]

Here is the summary with links:
  - [net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin()
    https://git.kernel.org/netdev/net-next/c/788f63c4dc17

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-03 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-08  7:03 [PATCH net-next] net: microchip: sparx5: clean up error checking in vcap_show_admin() Dan Carpenter
2023-09-08  7:48 ` Simon Horman
2023-09-08  8:27 ` Daniel Machon
2023-10-03 14:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).