[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231208095817.5aa69755@kernel.org>
Date: Fri, 8 Dec 2023 09:58:17 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: David Wei <dw@...idwei.uk>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>, Eric
Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 1/3] netdevsim: allow two netdevsim ports to be
On Thu, 7 Dec 2023 09:21:15 -0800 David Wei wrote:
> + ret = copy_from_user(buf, data, count);
> + if (ret)
> + return -EFAULT;
> + buf[count] = '\0';
> +
> + cur = buf;
> + token = strsep(&cur, " ");
> + if (!token)
> + return -EINVAL;
> + ret = kstrtouint(token, 10, &id);
> + if (ret)
> + return ret;
> +
> + token = strsep(&cur, " ");
> + if (!token)
> + return -EINVAL;
> + ret = kstrtouint(token, 10, &port);
> + if (ret)
> + return ret;
> +
> + /* too many args */
> + if (strsep(&cur, " "))
> + return -E2BIG;
What's wrong with scanf?
Powered by blists - more mailing lists