public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: <dan.carpenter@oracle.com>
To: lorenzo@kernel.org
Cc: linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [bug report] mt76: mt7615: wake device before accessing regmap in debugfs
Date: Tue, 4 Aug 2020 13:45:35 +0300	[thread overview]
Message-ID: <20200804104535.GA398141@mwanda> (raw)

Hello Lorenzo Bianconi,

The patch ea4906c4be49: "mt76: mt7615: wake device before accessing
regmap in debugfs" from Jul 3, 2020, leads to the following static
checker warning:

	drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c:179 mt7615_reset_test_set()
	warn: inconsistent returns 'dev->mt76.mutex'.

drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c
   159  static int
   160  mt7615_reset_test_set(void *data, u64 val)
   161  {
   162          struct mt7615_dev *dev = data;
   163          struct sk_buff *skb;
   164  
   165          if (!mt7615_wait_for_mcu_init(dev))
   166                  return 0;
   167  
   168          mt7615_mutex_acquire(dev);
   169  
   170          skb = alloc_skb(1, GFP_KERNEL);
   171          if (!skb)
   172                  return -ENOMEM;
                        ^^^^^^^^^^^^^^
This is returning with the mutex held.  What is the mutex protecting?
We could move the allocation and the skb_put() before the
mt7615_mutex_acquire().

   173  
   174          skb_put(skb, 1);
   175          mt76_tx_queue_skb_raw(dev, 0, skb, 0);
   176  
   177          mt7615_mutex_release(dev);
   178  
   179          return 0;
   180  }

regards,
dan carpenter

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

             reply	other threads:[~2020-08-04 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 10:45 dan.carpenter [this message]
2020-08-08 18:01 ` [bug report] mt76: mt7615: wake device before accessing regmap in debugfs Lorenzo Bianconi

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=20200804104535.GA398141@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox