linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: i@hexchain.org
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] avctp: Fix EINVAL on uinput creation
Date: Mon, 13 Jan 2020 17:35:32 -0800	[thread overview]
Message-ID: <CABBYNZJRTTXsgrYCnS2rb=e5Ppg+GiCOx1iQ5X08R_sV-Ua4Rg@mail.gmail.com> (raw)
In-Reply-To: <20200112004226.GA432297@kotori.hexchain.org>

Hi,

On Sat, Jan 11, 2020 at 4:49 PM Haochen Tong <i@hexchain.org> wrote:
>
> The struct uinput_dev variable is on stack, so clear its content to
> avoid accidentally writing garbage values to kernel. This fixes "Can't
> create uinput device: Invalid argument (22)" in some cases.
>
> Signed-off-by: Haochen Tong <i@hexchain.org>

Ive the remove the line above since we don't use it for userspace
patches, see HACKING.

> ---
>  profiles/audio/avctp.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
> index d3b5dfab9..f7a3de211 100644
> --- a/profiles/audio/avctp.c
> +++ b/profiles/audio/avctp.c
> @@ -1182,6 +1182,8 @@ static int uinput_create(struct btd_device *device, const char *name,
>                 }
>         }
>
> +       memset(&dev, 0, sizeof(struct uinput_dev));

Ive change the above like to use sizeof(dev)

>         if (name) {
>                 strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE);
>                 dev.name[UINPUT_MAX_NAME_SIZE - 1] = '\0';
>
> base-commit: b4270d79e19ee70ccab6c087a7b470dad8a8a8bf
> --
> 2.24.1

Applied, thanks.

-- 
Luiz Augusto von Dentz

      reply	other threads:[~2020-01-14  1:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12  0:42 [PATCH] avctp: Fix EINVAL on uinput creation Haochen Tong
2020-01-14  1:35 ` Luiz Augusto von Dentz [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='CABBYNZJRTTXsgrYCnS2rb=e5Ppg+GiCOx1iQ5X08R_sV-Ua4Rg@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=i@hexchain.org \
    --cc=linux-bluetooth@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).