All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: mpubbise@codeaurora.org
Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org
Subject: [bug report] ath11k: handle RX fragments
Date: Tue, 7 Apr 2020 16:41:15 +0300	[thread overview]
Message-ID: <20200407134115.GA108129@mwanda> (raw)

Hello Manikanta Pubbisetty,

The patch 243874c64c81: "ath11k: handle RX fragments" from Mar 16,
2020, leads to the following static checker warning:

	drivers/net/wireless/ath/ath11k/dp_rx.c:3365 ath11k_dp_rx_frag_h_mpdu()
	warn: missing error code here? 'ath11k_dp_rx_h_defrag()' failed. 'ret' = '0'

drivers/net/wireless/ath/ath11k/dp_rx.c
  3343                                                HAL_WBM_REL_BM_ACT_PUT_IN_IDLE);
  3344          }
  3345  
  3346          if (!rx_tid->last_frag_no ||
  3347              rx_tid->rx_frag_bitmap != GENMASK(rx_tid->last_frag_no, 0)) {
  3348                  mod_timer(&rx_tid->frag_timer, jiffies +
  3349                                                 ATH11K_DP_RX_FRAGMENT_TIMEOUT_MS);
  3350                  goto out_unlock;
                        ^^^^^^^^^^^^^^^

All these gotos should probably set error codes instead of returning
success.

  3351          }
  3352  
  3353          spin_unlock_bh(&ab->base_lock);
  3354          del_timer_sync(&rx_tid->frag_timer);
  3355          spin_lock_bh(&ab->base_lock);
  3356  
  3357          peer = ath11k_peer_find_by_id(ab, peer_id);
  3358          if (!peer)
  3359                  goto err_frags_cleanup;
                        ^^^^^^^^^^^^^^^^^^^^^^
Etc.

  3360  
  3361          if (!ath11k_dp_rx_h_defrag_validate_incr_pn(ar, rx_tid))
  3362                  goto err_frags_cleanup;
  3363  
  3364          if (ath11k_dp_rx_h_defrag(ar, peer, rx_tid, &defrag_skb))
  3365                  goto err_frags_cleanup;
  3366  
  3367          if (!defrag_skb)
  3368                  goto err_frags_cleanup;
  3369  
  3370          if (ath11k_dp_rx_h_defrag_reo_reinject(ar, rx_tid, defrag_skb))
  3371                  goto err_frags_cleanup;
  3372  
  3373          ath11k_dp_rx_frags_cleanup(rx_tid, false);
  3374          goto out_unlock;
  3375  
  3376  err_frags_cleanup:
  3377          dev_kfree_skb_any(defrag_skb);
  3378          ath11k_dp_rx_frags_cleanup(rx_tid, true);
  3379  out_unlock:
  3380          spin_unlock_bh(&ab->base_lock);
  3381          return ret;
  3382  }

regards,
dan carpenter

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: mpubbise@codeaurora.org
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: [bug report] ath11k: handle RX fragments
Date: Tue, 7 Apr 2020 16:41:15 +0300	[thread overview]
Message-ID: <20200407134115.GA108129@mwanda> (raw)

Hello Manikanta Pubbisetty,

The patch 243874c64c81: "ath11k: handle RX fragments" from Mar 16,
2020, leads to the following static checker warning:

	drivers/net/wireless/ath/ath11k/dp_rx.c:3365 ath11k_dp_rx_frag_h_mpdu()
	warn: missing error code here? 'ath11k_dp_rx_h_defrag()' failed. 'ret' = '0'

drivers/net/wireless/ath/ath11k/dp_rx.c
  3343                                                HAL_WBM_REL_BM_ACT_PUT_IN_IDLE);
  3344          }
  3345  
  3346          if (!rx_tid->last_frag_no ||
  3347              rx_tid->rx_frag_bitmap != GENMASK(rx_tid->last_frag_no, 0)) {
  3348                  mod_timer(&rx_tid->frag_timer, jiffies +
  3349                                                 ATH11K_DP_RX_FRAGMENT_TIMEOUT_MS);
  3350                  goto out_unlock;
                        ^^^^^^^^^^^^^^^

All these gotos should probably set error codes instead of returning
success.

  3351          }
  3352  
  3353          spin_unlock_bh(&ab->base_lock);
  3354          del_timer_sync(&rx_tid->frag_timer);
  3355          spin_lock_bh(&ab->base_lock);
  3356  
  3357          peer = ath11k_peer_find_by_id(ab, peer_id);
  3358          if (!peer)
  3359                  goto err_frags_cleanup;
                        ^^^^^^^^^^^^^^^^^^^^^^
Etc.

  3360  
  3361          if (!ath11k_dp_rx_h_defrag_validate_incr_pn(ar, rx_tid))
  3362                  goto err_frags_cleanup;
  3363  
  3364          if (ath11k_dp_rx_h_defrag(ar, peer, rx_tid, &defrag_skb))
  3365                  goto err_frags_cleanup;
  3366  
  3367          if (!defrag_skb)
  3368                  goto err_frags_cleanup;
  3369  
  3370          if (ath11k_dp_rx_h_defrag_reo_reinject(ar, rx_tid, defrag_skb))
  3371                  goto err_frags_cleanup;
  3372  
  3373          ath11k_dp_rx_frags_cleanup(rx_tid, false);
  3374          goto out_unlock;
  3375  
  3376  err_frags_cleanup:
  3377          dev_kfree_skb_any(defrag_skb);
  3378          ath11k_dp_rx_frags_cleanup(rx_tid, true);
  3379  out_unlock:
  3380          spin_unlock_bh(&ab->base_lock);
  3381          return ret;
  3382  }

regards,
dan carpenter

             reply	other threads:[~2020-04-07 13:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 13:41 Dan Carpenter [this message]
2020-04-07 13:41 ` [bug report] ath11k: handle RX fragments Dan Carpenter
     [not found] ` <BY5PR02MB6820A065D360B48F7251CADAF7DD0@BY5PR02MB6820.namprd02.prod.outlook.com>
2020-04-13 13:18   ` Sriram R
2020-04-13 13:18     ` Sriram R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200407134115.GA108129@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ath11k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mpubbise@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.