lkml.org 
[lkml]   [2023]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] wifi: ath11k: fix temperature event locking
On Thu, Oct 19, 2023 at 08:04:55AM -0700, Jeff Johnson wrote:
> On 10/19/2023 3:42 AM, Johan Hovold wrote:
> > The ath11k active pdevs are protected by RCU but the temperature event
> > handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a
> > read-side critical section as reported by RCU lockdep:
>
> How do I enable this? Just enable CONFIG_PROVE_RCU?

Yeah, via CONFIG_PROVE_LOCKING.

> Of course I'd also need to exercise the code path...

Right, this one I hit when reading out the sensor temperature (e.g.
using lm_sensors).

> > + rcu_read_lock();
> > +
> > ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id);
> > if (!ar) {
> > ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id);
>
> aren't you missing an unlock() in this error path?
>
> perhaps have a goto cleanup that does both the unlock() and the kfree()?

Bah, I am, thanks for catching that.

Spent too much time on scanning for further instances that I didn't
check the first one properly. Sorry about that. Will send a v2.

Johan

\
 
 \ /
  Last update: 2023-10-19 17:20    [W:0.133 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site