All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Kalle Valo <kvalo@kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH 1/2] wifi: rtw89: simplify rtw89_debug_priv_mac_reg_dump_select()
Date: Wed, 12 Feb 2025 05:35:58 +0000	[thread overview]
Message-ID: <6e498ecb91a440199539fcc001b9af4b@realtek.com> (raw)
In-Reply-To: <20250211073915.648418-1-dmantipov@yandex.ru>

Dmitry Antipov <dmantipov@yandex.ru> wrote:
> Simplify 'rtw89_debug_priv_mac_reg_dump_select()' by using
> the convenient 'kstrtoint_from_user()'. Compile tested only.
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>

The function has been changed, because of switch wiphy_lock(). 
No copy_from_user() now. Skip this patch. 

> ---
>  drivers/net/wireless/realtek/rtw89/debug.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c
> index 09fa977a6e6d..339f9f6672fd 100644
> --- a/drivers/net/wireless/realtek/rtw89/debug.c
> +++ b/drivers/net/wireless/realtek/rtw89/debug.c
> @@ -924,17 +924,10 @@ rtw89_debug_priv_mac_reg_dump_select(struct file *filp,
>         struct rtw89_debugfs_priv *debugfs_priv = m->private;
>         struct rtw89_dev *rtwdev = debugfs_priv->rtwdev;
>         const struct rtw89_chip_info *chip = rtwdev->chip;
> -       char buf[32];
> -       size_t buf_size;
>         int sel;
>         int ret;
> 
> -       buf_size = min(count, sizeof(buf) - 1);
> -       if (copy_from_user(buf, user_buf, buf_size))
> -               return -EFAULT;
> -
> -       buf[buf_size] = '\0';
> -       ret = kstrtoint(buf, 0, &sel);
> +       ret = kstrtoint_from_user(user_buf, count, 0, &sel);
>         if (ret)
>                 return ret;
> 
> --
> 2.48.1
> 


      parent reply	other threads:[~2025-02-12  5:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11  7:39 [PATCH 1/2] wifi: rtw89: simplify rtw89_debug_priv_mac_reg_dump_select() Dmitry Antipov
2025-02-11  7:39 ` [PATCH 2/2] wifi: rtw89: rtw8852b{t}: fix TSSI debug timestamps Dmitry Antipov
2025-02-12  5:42   ` Ping-Ke Shih
2025-02-12  7:38     ` [PATCH v2] " Dmitry Antipov
2025-02-13  0:45       ` Ping-Ke Shih
2025-02-13  5:42         ` [PATCH v3] " Dmitry Antipov
2025-02-13  7:55           ` Ping-Ke Shih
2025-02-13  9:50             ` [PATCH v4] " Dmitry Antipov
2025-02-21  1:36               ` Ping-Ke Shih
2025-02-12  5:35 ` Ping-Ke Shih [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=6e498ecb91a440199539fcc001b9af4b@realtek.com \
    --to=pkshih@realtek.com \
    --cc=dmantipov@yandex.ru \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.