From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Hui Peng <benquike@gmail.com>
Cc: robin@protonic.nl, mkl@pengutronix.de, mailhol@kernel.org,
kernel@pengutronix.de, socketcan@hartkopp.net,
linux-can@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] can: j1939: return 0 instead of user value in j1939_sk_setsockopt_flag()
Date: Fri, 27 Nov 2026 12:19:46 +0100 [thread overview]
Message-ID: <awlnUrAP4PGtg4OO@pengutronix.de> (raw)
In-Reply-To: <20260919213632.3313825-1-benquike@gmail.com>
Hi Hui,
thank you, and sorry for the long silence.
On Sat, Sep 19, 2026 at 09:36:32PM +0000, Hui Peng wrote:
> In `j1939_sk_setsockopt_flag()`, after copying the integer option value
> `tmp` from userspace and updating `jsk->state`, the function returns
> `tmp` instead of `0`.
>
> If a caller passes a negative integer (e.g., `-1`) to enable
> `SO_J1939_BROADCAST` or `SO_J1939_PROMISC`, `if (tmp)` sets `jsk->state
> |= flag` and then returns the negative value as an error code from
> `setsockopt()`. If a caller passes a positive non-zero integer (e.g.,
> `1`), `setsockopt()` violates POSIX by returning `1` instead of `0`.
>
> Return `0` on success in `j1939_sk_setsockopt_flag()`.
>
> Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
> Assisted-by: LLM
> Signed-off-by: Hui Peng <benquike@gmail.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
For next time: CAN patches go to linux-can and the CAN maintainers
only, please do not send them to netdev.
Regards,
Oleksij
prev parent reply other threads:[~2026-11-27 11:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 21:36 [PATCH] can: j1939: return 0 instead of user value in j1939_sk_setsockopt_flag() Hui Peng
2026-09-22 12:20 ` Simon Horman
2026-11-27 11:19 ` Oleksij Rempel [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=awlnUrAP4PGtg4OO@pengutronix.de \
--to=o.rempel@pengutronix.de \
--cc=benquike@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol@kernel.org \
--cc=mkl@pengutronix.de \
--cc=robin@protonic.nl \
--cc=socketcan@hartkopp.net \
/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