From: Dan Carpenter <dan.carpenter@oracle.com>
To: kvalo@codeaurora.org
Cc: ath11k@lists.infradead.org
Subject: [bug report] ath11k: driver for Qualcomm IEEE 802.11ax devices
Date: Fri, 13 Dec 2019 13:53:35 +0300 [thread overview]
Message-ID: <20191213105335.lg7n627mhas6spcy@kili.mountain> (raw)
Hello Kalle Valo,
This is a semi-automatic email about new static checker warnings.
The patch d5c65159f289: "ath11k: driver for Qualcomm IEEE 802.11ax
devices" from Nov 23, 2019, leads to the following Smatch complaint:
drivers/net/wireless/ath/ath11k/ce.c:192 ath11k_ce_rx_post_pipe()
error: we previously assumed 'pipe->dest_ring' could be null (see line 167)
drivers/net/wireless/ath/ath11k/ce.c
166
167 if (!(pipe->dest_ring || pipe->status_ring))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This checks that at least one is non-NULL but it should check that both
are non-NULL, probably?
if (!pipe->dest_ring || !pipe->status_ring)
168 return 0;
169
170 spin_lock_bh(&ab->ce.ce_lock);
171 while (pipe->rx_buf_needed) {
172 skb = dev_alloc_skb(pipe->buf_sz);
173 if (!skb) {
174 ret = -ENOMEM;
175 goto exit;
176 }
177
178 WARN_ON_ONCE(!IS_ALIGNED((unsigned long)skb->data, 4));
179
180 paddr = dma_map_single(ab->dev, skb->data,
181 skb->len + skb_tailroom(skb),
182 DMA_FROM_DEVICE);
183 if (unlikely(dma_mapping_error(ab->dev, paddr))) {
184 ath11k_warn(ab, "failed to dma map ce rx buf\n");
185 dev_kfree_skb_any(skb);
186 ret = -EIO;
187 goto exit;
188 }
189
190 ATH11K_SKB_RXCB(skb)->paddr = paddr;
191
192 ret = ath11k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr);
^^^^
pipe->dest_ring is dereferenced inside the function.
193
194 if (ret) {
regards,
dan carpenter
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
next reply other threads:[~2019-12-13 10:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 10:53 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-12-13 12:39 [bug report] ath11k: driver for Qualcomm IEEE 802.11ax devices Dan Carpenter
2019-12-13 10:51 Dan Carpenter
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=20191213105335.lg7n627mhas6spcy@kili.mountain \
--to=dan.carpenter@oracle.com \
--cc=ath11k@lists.infradead.org \
--cc=kvalo@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.