All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] android/ion: fix error return code in opensocket()
@ 2020-11-18 10:47 Wang Hai
  2020-11-18 17:08 ` Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Hai @ 2020-11-18 10:47 UTC (permalink / raw)
  To: shuah, pintu.ping; +Cc: linux-kselftest, linux-kernel

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 47a18c42d992 ("android/ion: userspace test utility for ion buffer sharing")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
---
v1->v2: add missing ";"
 tools/testing/selftests/android/ion/ipcsocket.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/android/ion/ipcsocket.c b/tools/testing/selftests/android/ion/ipcsocket.c
index 7dc521002095..13b3455ba39c 100644
--- a/tools/testing/selftests/android/ion/ipcsocket.c
+++ b/tools/testing/selftests/android/ion/ipcsocket.c
@@ -28,8 +28,9 @@ int opensocket(int *sockfd, const char *name, int connecttype)
 	}
 
 	*sockfd = ret;
-	if (setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR,
-		(char *)&temp, sizeof(int)) < 0) {
+	ret = setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&temp,
+			 sizeof(int));
+	if (ret < 0) {
 		fprintf(stderr, "<%s>: Failed setsockopt: <%s>\n",
 		__func__, strerror(errno));
 		goto err;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] android/ion: fix error return code in opensocket()
  2020-11-18 10:47 [PATCH v2] android/ion: fix error return code in opensocket() Wang Hai
@ 2020-11-18 17:08 ` Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2020-11-18 17:08 UTC (permalink / raw)
  To: Wang Hai, shuah, pintu.ping
  Cc: linux-kselftest, linux-kernel, skhan, Greg Kroah-Hartman

On 11/18/20 3:47 AM, Wang Hai wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: 47a18c42d992 ("android/ion: userspace test utility for ion buffer sharing")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> ---
> v1->v2: add missing ";"
>   tools/testing/selftests/android/ion/ipcsocket.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/android/ion/ipcsocket.c b/tools/testing/selftests/android/ion/ipcsocket.c
> index 7dc521002095..13b3455ba39c 100644
> --- a/tools/testing/selftests/android/ion/ipcsocket.c
> +++ b/tools/testing/selftests/android/ion/ipcsocket.c
> @@ -28,8 +28,9 @@ int opensocket(int *sockfd, const char *name, int connecttype)
>   	}
>   
>   	*sockfd = ret;
> -	if (setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR,
> -		(char *)&temp, sizeof(int)) < 0) {
> +	ret = setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&temp,
> +			 sizeof(int));
> +	if (ret < 0) {
>   		fprintf(stderr, "<%s>: Failed setsockopt: <%s>\n",
>   		__func__, strerror(errno));
>   		goto err;
> 

This test is slated removal and I have stopped accepting patches that
aren't critical fixes at this time.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-18 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 10:47 [PATCH v2] android/ion: fix error return code in opensocket() Wang Hai
2020-11-18 17:08 ` Shuah Khan

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.