Question about a return value in drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

in file 'drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c', in function 'mlxsw_sp_router_fib4_del', the code:

    ...
    vr = mlxsw_sp_vr_find(mlxsw_sp, fib4->tb_id, MLXSW_SP_L3_PROTO_IPV4);
    if (!vr) {
dev_warn(mlxsw_sp->bus_info->dev, "Failed to find virtual router for FIB4 entry being removed.\n");
        return -ENOENT;
    }
    fib_entry = mlxsw_sp_fib_entry_lookup(vr->fib, &fib4->dst,
                          sizeof(fib4->dst), fib4->dst_len);
    if (!fib_entry) {
dev_warn(mlxsw_sp->bus_info->dev, "Failed to find FIB4 entry being removed.\n");
        return PTR_ERR(vr);     <---------------------------------------
    }
    ...

looks spurious.

is the 'return PTR_ERR(vr)' correct?
vr should be a valid pointer at this point. It is used a few lines above in 'vr->fib'.

Best regards,

CJ



--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux