[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161019113345.GJ4469@mwanda>
Date: Wed, 19 Oct 2016 14:33:46 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Brian Masney <masneyb@...tation.org>
Cc: jic23@...nel.org, devel@...verdev.osuosl.org, lars@...afoo.de,
linux-iio@...r.kernel.org, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org, pmeerw@...erw.net, knaack.h@....de
Subject: Re: [PATCH 6/7] iio: light: tsl2583: add locking to sysfs *_store()
functions
On Wed, Oct 19, 2016 at 06:32:09AM -0400, Brian Masney wrote:
> @@ -778,6 +796,8 @@ static ssize_t illuminance0_lux_table_store(struct device *dev,
> goto luxable_store_done;
> }
>
> + mutex_lock(&chip->als_mutex);
> +
> if (chip->taos_chip_status == TSL258X_CHIP_WORKING) {
> ret = taos_chip_off(indio_dev);
> if (ret < 0)
> @@ -794,6 +814,8 @@ static ssize_t illuminance0_lux_table_store(struct device *dev,
>
> ret = len;
>
> + mutex_unlock(&chip->als_mutex);
> +
> luxable_store_done:
> return ret;
> }
HAHAHHA HAHAHAH HAH AHHA HAHHAH AH HAHAHHAHAH AHHAHHAHAHHA HAHA HAHAHAH.
*wipes tear from eye*. *continues laughing*.
HAHAHAHAHHAHAHA HAHA HAHAHAHA HAHAHA HAHAHAH AHAHAHAHA AHHAHAH.
This patch introduces a return with lock held bug. All those do nothing
gotos, and we still missed when we actually had to do a "goto unlock".
If every function is special and complicated that reall means that no
functions are special.
Don't do do-nothing gotos.
regards,
dan carpenter
Powered by blists - more mailing lists