]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: netcp: Fix an error message
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 8 May 2021 05:38:22 +0000 (07:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 06:22:08 +0000 (08:22 +0200)
[ Upstream commit ddb6e00f8413e885ff826e32521cff7924661de0 ]

'ret' is known to be 0 here.
The expected error code is stored in 'tx_pipe->dma_queue', so use it
instead.

While at it, switch from %d to %pe which is more user friendly.

Fixes: 84640e27f230 ("net: netcp: Add Keystone NetCP core ethernet driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/ti/netcp_core.c

index 37b9b39192ec436c63c7eac55fdddf5060e376d9..463c6db67146ceb2c312bdbdedb9f0077927c651 100644 (file)
@@ -1284,9 +1284,9 @@ int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe)
        tx_pipe->dma_queue = knav_queue_open(name, tx_pipe->dma_queue_id,
                                             KNAV_QUEUE_SHARED);
        if (IS_ERR(tx_pipe->dma_queue)) {
+               ret = PTR_ERR(tx_pipe->dma_queue);
                dev_err(dev, "Could not open DMA queue for channel \"%s\": %d\n",
                        name, ret);
-               ret = PTR_ERR(tx_pipe->dma_queue);
                goto err;
        }