drivers/net/ethernet/microsoft/mana/mana_bpf.c | 3 --- 1 file changed, 3 deletions(-)
mana_bpf() declares an uninitialized 'ret' and falls through to a
trailing 'return ret;' after a switch statement whose every case
(XDP_SETUP_PROG and default) already returns unconditionally. This
statement is therefore unreachable dead code left over from an
earlier refactor, and it would return an uninitialized value if it
were ever reached.
Drop the unused variable and the unreachable return.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
drivers/net/ethernet/microsoft/mana/mana_bpf.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/microsoft/mana/mana_bpf.c b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
index 53308e139cbe9..70bb8c9dc3413 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_bpf.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
@@ -253,7 +253,6 @@ static int mana_xdp_set(struct net_device *ndev, struct bpf_prog *prog,
int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
{
struct netlink_ext_ack *extack = bpf->extack;
- int ret;
switch (bpf->command) {
case XDP_SETUP_PROG:
@@ -262,6 +261,4 @@ int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
default:
return -EOPNOTSUPP;
}
-
- return ret;
}
--
2.55.0
On 8/24/26 9:09 AM, Muhammad Falak R Wani wrote: > mana_bpf() declares an uninitialized 'ret' and falls through to a > trailing 'return ret;' after a switch statement whose every case > (XDP_SETUP_PROG and default) already returns unconditionally. This > statement is therefore unreachable dead code left over from an > earlier refactor, and it would return an uninitialized value if it > were ever reached. > > Drop the unused variable and the unreachable return. > > Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> ## Form letter - net-next-closed net-next pull request for v7.3 has already been merged, and therefore the net-next tree is closed for new drivers, features, code refactoring and optimizations. We are currently accepting bug fixes only. Please repost when net-next reopens after Aug 31st. RFC patches sent for review only are obviously welcome at any time. See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle -- pw-bot: defer pv-bot: closed
On Mon, Aug 24, 2026 at 12:39:06PM +0530, Muhammad Falak R Wani wrote:
> mana_bpf() declares an uninitialized 'ret' and falls through to a
> trailing 'return ret;' after a switch statement whose every case
> (XDP_SETUP_PROG and default) already returns unconditionally. This
> statement is therefore unreachable dead code left over from an
> earlier refactor, and it would return an uninitialized value if it
> were ever reached.
>
> Drop the unused variable and the unreachable return.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Fixes: ed5356b53f07 ("net: mana: Add XDP support")
Reviewed-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
> ---
> drivers/net/ethernet/microsoft/mana/mana_bpf.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_bpf.c b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> index 53308e139cbe9..70bb8c9dc3413 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> @@ -253,7 +253,6 @@ static int mana_xdp_set(struct net_device *ndev, struct bpf_prog *prog,
> int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
> {
> struct netlink_ext_ack *extack = bpf->extack;
> - int ret;
>
> switch (bpf->command) {
> case XDP_SETUP_PROG:
> @@ -262,6 +261,4 @@ int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
> default:
> return -EOPNOTSUPP;
> }
> -
> - return ret;
> }
> --
> 2.55.0
>
On 8/24/26 4:21 PM, Hamza Mahfooz wrote:
> On Mon, Aug 24, 2026 at 12:39:06PM +0530, Muhammad Falak R Wani wrote:
>> mana_bpf() declares an uninitialized 'ret' and falls through to a
>> trailing 'return ret;' after a switch statement whose every case
>> (XDP_SETUP_PROG and default) already returns unconditionally. This
>> statement is therefore unreachable dead code left over from an
>> earlier refactor, and it would return an uninitialized value if it
>> were ever reached.
>>
>> Drop the unused variable and the unreachable return.
>>
>> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
>
> Fixes: ed5356b53f07 ("net: mana: Add XDP support")
> Reviewed-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Please note that the current guidance is no fixes tag for net-next changes.
Also this specific change does not address any real issue, it's just
code cleanup.
/P
© 2016 - 2026 Red Hat, Inc.