[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfgSKNlCm/3DnRmD@kroah.com>
Date: Mon, 31 Jan 2022 17:45:28 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@...il.com>,
realwakka@...il.com, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] staging: pi433: add debugfs interface
On Mon, Jan 31, 2022 at 04:45:58PM +0300, Dan Carpenter wrote:
> On Sun, Jan 30, 2022 at 03:57:26PM +1300, Paulo Miguel Almeida wrote:
> > @@ -1102,12 +1104,75 @@ static const struct file_operations pi433_fops = {
> > .llseek = no_llseek,
> > };
> >
> > +static int pi433_debugfs_regs_show(struct seq_file *m, void *p)
> > +{
> > + struct pi433_device *dev;
> > + u8 reg_data[114];
> > + int i;
> > + char *fmt = "0x%02x, 0x%02x\n";
> > + int ret = 0;
>
> No need to initialize. Bogus initializers just disable ten thousand
> person hours spent developing static analysis.
>
> > +
> > + dev = m->private;
> > +
> > + mutex_lock(&dev->tx_fifo_lock);
> > + mutex_lock(&dev->rx_lock);
> > +
> > + // wait for on-going operations to finish
> > + ret = wait_event_interruptible(dev->rx_wait_queue, !dev->tx_active);
> > + if (ret)
> > + return ret;
>
> Drop the two mutexes before returning.
Ick, I missed that. I'll go drop this patch from my tree now, good
catch.
greg k-h
Powered by blists - more mailing lists