Patch "selftest: net: Assert on a proper value in so_incoming_cpu.c." has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftest: net: Assert on a proper value in so_incoming_cpu.c.

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftest-net-assert-on-a-proper-value-in-so_incoming.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c85aa69ea9cd8b11739fd8de27221dbf8a337568
Author: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
Date:   Mon Jul 31 11:15:53 2023 -0700

    selftest: net: Assert on a proper value in so_incoming_cpu.c.
    
    [ Upstream commit 3ff1617450eceb290ac17120fc172815e09a93cf ]
    
    Dan Carpenter reported an error spotted by Smatch.
    
      ./tools/testing/selftests/net/so_incoming_cpu.c:163 create_clients()
      error: uninitialized symbol 'ret'.
    
    The returned value of sched_setaffinity() should be checked with
    ASSERT_EQ(), but the value was not saved in a proper variable,
    resulting in an error above.
    
    Let's save the returned value of with sched_setaffinity().
    
    Fixes: 6df96146b202 ("selftest: Add test for SO_INCOMING_CPU.")
    Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Closes: https://lore.kernel.org/linux-kselftest/fe376760-33b6-4fc9-88e8-178e809af1ac@moroto.mountain/
    Signed-off-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230731181553.5392-1-kuniyu@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/net/so_incoming_cpu.c b/tools/testing/selftests/net/so_incoming_cpu.c
index 0e04f9fef9867..a148181641026 100644
--- a/tools/testing/selftests/net/so_incoming_cpu.c
+++ b/tools/testing/selftests/net/so_incoming_cpu.c
@@ -159,7 +159,7 @@ void create_clients(struct __test_metadata *_metadata,
 		/* Make sure SYN will be processed on the i-th CPU
 		 * and finally distributed to the i-th listener.
 		 */
-		sched_setaffinity(0, sizeof(cpu_set), &cpu_set);
+		ret = sched_setaffinity(0, sizeof(cpu_set), &cpu_set);
 		ASSERT_EQ(ret, 0);
 
 		for (j = 0; j < CLIENT_PER_SERVER; j++) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux