netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] octeontx2-pf: unlock on error path in otx2_config_pause_frm()
@ 2020-03-12 11:30 Dan Carpenter
  2020-03-12 22:53 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2020-03-12 11:30 UTC (permalink / raw)
  To: Sunil Goutham, Geetha sowjanya
  Cc: Subbaraya Sundeep, hariprasad, David S. Miller, Andrew Lunn,
	netdev, kernel-janitors

We need to unlock before returning if this allocation fails.

Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
index af4437d4dfcb..157735443473 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
@@ -227,14 +227,17 @@ int otx2_config_pause_frm(struct otx2_nic *pfvf)
 
 	otx2_mbox_lock(&pfvf->mbox);
 	req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
-	if (!req)
-		return -ENOMEM;
+	if (!req) {
+		err = -ENOMEM;
+		goto unlock;
+	}
 
 	req->rx_pause = !!(pfvf->flags & OTX2_FLAG_RX_PAUSE_ENABLED);
 	req->tx_pause = !!(pfvf->flags & OTX2_FLAG_TX_PAUSE_ENABLED);
 	req->set = 1;
 
 	err = otx2_sync_mbox_msg(&pfvf->mbox);
+unlock:
 	otx2_mbox_unlock(&pfvf->mbox);
 	return err;
 }
-- 
2.20.1


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

* Re: [PATCH] octeontx2-pf: unlock on error path in otx2_config_pause_frm()
  2020-03-12 11:30 [PATCH] octeontx2-pf: unlock on error path in otx2_config_pause_frm() Dan Carpenter
@ 2020-03-12 22:53 ` David Miller
  2020-03-13  6:10   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2020-03-12 22:53 UTC (permalink / raw)
  To: dan.carpenter
  Cc: sgoutham, gakula, sbhatta, hkelam, andrew, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 12 Mar 2020 14:30:48 +0300

> We need to unlock before returning if this allocation fails.
> 
> Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to net-next.

Dan, please indicate the appropriate target tree in your Subject lines
in the future.  I have to dance around my GIT trees to figure out where
your patches apply and that eats up more time than necessary.

Thanks.

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

* Re: [PATCH] octeontx2-pf: unlock on error path in otx2_config_pause_frm()
  2020-03-12 22:53 ` David Miller
@ 2020-03-13  6:10   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-03-13  6:10 UTC (permalink / raw)
  To: David Miller
  Cc: sgoutham, gakula, sbhatta, hkelam, andrew, netdev, kernel-janitors

On Thu, Mar 12, 2020 at 03:53:21PM -0700, David Miller wrote:
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Date: Thu, 12 Mar 2020 14:30:48 +0300
> 
> > We need to unlock before returning if this allocation fails.
> > 
> > Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Applied to net-next.
> 
> Dan, please indicate the appropriate target tree in your Subject lines
> in the future.  I have to dance around my GIT trees to figure out where
> your patches apply and that eats up more time than necessary.

Sorry, I've been trying to do that but I forgot.  I'm going to update
my QC scripts so hopefully it doesn't happen again.

regards,
dan carpenter


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

end of thread, other threads:[~2020-03-13  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 11:30 [PATCH] octeontx2-pf: unlock on error path in otx2_config_pause_frm() Dan Carpenter
2020-03-12 22:53 ` David Miller
2020-03-13  6:10   ` Dan Carpenter

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).