mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
selftests/net: initialize char variable to null
char variable in 'so_txtime.c' & 'txtimestamp.c' were left uninitilized when switch default case taken. which raises following warning. txtimestamp.c:240:2: warning: variable 'tsname' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] so_txtime.c:210:3: warning: variable 'reason' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] initializing these variables to NULL to fix this. Signed-off-by: Ankit Khushwaha <ankitkhushwaha.linux@gmail.com> Link: https://patch.msgid.link/20251125165302.20079-1-ankitkhushwaha.linux@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ab084f0b8d
commit
af7273cc7a
|
|
@ -174,7 +174,7 @@ static int do_recv_errqueue_timeout(int fdt)
|
|||
msg.msg_controllen = sizeof(control);
|
||||
|
||||
while (1) {
|
||||
const char *reason;
|
||||
const char *reason = NULL;
|
||||
|
||||
ret = recvmsg(fdt, &msg, MSG_ERRQUEUE);
|
||||
if (ret == -1 && errno == EAGAIN)
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ static void print_timestamp_usr(void)
|
|||
static void print_timestamp(struct scm_timestamping *tss, int tstype,
|
||||
int tskey, int payload_len)
|
||||
{
|
||||
const char *tsname;
|
||||
const char *tsname = NULL;
|
||||
|
||||
validate_key(tskey, tstype);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user