linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: linus.walleij@linaro.org, linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, john.stultz@linaro.org,
	amit.pundir@linaro.org, bjorn.andersson@linaro.org,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v2] gpio: wcd934x: Fix shift-out-of-bounds error
Date: Tue, 4 May 2021 13:37:43 +0100	[thread overview]
Message-ID: <e50f575c-9726-d8e3-4762-c25813cb76c3@linaro.org> (raw)
In-Reply-To: <20210310174304.22176-1-srinivas.kandagatla@linaro.org>

Hi Linus,

On 10/03/2021 17:43, Srinivas Kandagatla wrote:
> bit-mask for pins 0 to 4 is BIT(0) to BIT(4) however we ended up with BIT(n - 1)
> which is not right, and this was caught by below usban check
> 
> UBSAN: shift-out-of-bounds in drivers/gpio/gpio-wcd934x.c:34:14
> 
> Fixes: 59c324683400 ("gpio: wcd934x: Add support to wcd934x gpio controller")
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---

Looks like this patch was missed. Without this audio on DragonBoard 
DB845c is broken once rc1 is out, as the corresponding dts changes are 
already in next.

Any chance to get this in .. maybe after rc1?


--srini

> changes since v1:
> 	- removed unnecessary dump stack from log
> 
>   drivers/gpio/gpio-wcd934x.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-wcd934x.c b/drivers/gpio/gpio-wcd934x.c
> index 1cbce5990855..97e6caedf1f3 100644
> --- a/drivers/gpio/gpio-wcd934x.c
> +++ b/drivers/gpio/gpio-wcd934x.c
> @@ -7,7 +7,7 @@
>   #include <linux/slab.h>
>   #include <linux/of_device.h>
>   
> -#define WCD_PIN_MASK(p) BIT(p - 1)
> +#define WCD_PIN_MASK(p) BIT(p)
>   #define WCD_REG_DIR_CTL_OFFSET 0x42
>   #define WCD_REG_VAL_CTL_OFFSET 0x43
>   #define WCD934X_NPINS		5
> 

      parent reply	other threads:[~2021-05-04 12:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 17:43 [PATCH v2] gpio: wcd934x: Fix shift-out-of-bounds error Srinivas Kandagatla
2021-03-10 23:32 ` Bjorn Andersson
2021-05-04 12:37 ` Srinivas Kandagatla [this message]

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=e50f575c-9726-d8e3-4762-c25813cb76c3@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=amit.pundir@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).