]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
octeontx2-af: Fix error code in rvu_mbox_init()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 25 Jun 2025 15:23:05 +0000 (10:23 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Jun 2025 09:34:20 +0000 (10:34 +0100)
The error code was intended to be -EINVAL here, but it was accidentally
changed to returning success.  Set the error code.

Fixes: e53ee4acb220 ("octeontx2-af: CN20k basic mbox operations and structures")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/af/rvu.c

index 7e538ee8a59fb943418a385fa5763f65c0bf4c8c..c6bb3aaa8e0d03be797a45f90d7c5d11fc3e9c1c 100644 (file)
@@ -2458,9 +2458,9 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw,
                         void (mbox_handler)(struct work_struct *),
                         void (mbox_up_handler)(struct work_struct *))
 {
-       int err = -EINVAL, i, dir, dir_up;
        void __iomem **mbox_regions;
        struct ng_rvu *ng_rvu_mbox;
+       int err, i, dir, dir_up;
        void __iomem *reg_base;
        struct rvu_work *mwork;
        unsigned long *pf_bmap;
@@ -2526,6 +2526,7 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw,
                        goto free_regions;
                break;
        default:
+               err = -EINVAL;
                goto free_regions;
        }