From: Dan Carpenter <[email protected]>
To: [email protected], David Howells <[email protected]>
Cc: [email protected], [email protected],
Ammar Faizi <[email protected]>,
GNU/Weeb Mailing List <[email protected]>,
[email protected]
Subject: [ammarfaizi2-block:dhowells/linux-fs/afs-testing 7/25] net/rxrpc/output.c:193 rxrpc_send_ack_packet() error: uninitialized symbol 'pkt'.
Date: Mon, 12 Sep 2022 17:25:03 +0300 [thread overview]
Message-ID: <[email protected]> (raw)
tree: https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/afs-testing
head: 2bf929f6fa4538b542f38c93177e4cd5860d90d7
commit: 6a54a9d0ea0f8bf65b344122998933a9c307a0f0 [7/25] rxrpc: Allocate ACK records at proposal and queue for transmission
config: parisc-randconfig-m031-20220908 (https://download.01.org/0day-ci/archive/20220910/[email protected]/config)
compiler: hppa-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
New smatch warnings:
net/rxrpc/output.c:193 rxrpc_send_ack_packet() error: uninitialized symbol 'pkt'.
net/rxrpc/recvmsg.c:604 rxrpc_recvmsg() error: we previously assumed 'call->peer' could be null (see line 586)
vim +/pkt +193 net/rxrpc/output.c
6a54a9d0ea0f8b David Howells 2020-01-30 163 static int rxrpc_send_ack_packet(struct rxrpc_local *local, struct rxrpc_txbuf *txb)
8d94aa381dab19 David Howells 2016-09-07 164 {
5273a191dca65a David Howells 2020-01-30 165 struct rxrpc_connection *conn;
26cb02aa6d3efe David Howells 2016-10-06 166 struct rxrpc_ack_buffer *pkt;
6a54a9d0ea0f8b David Howells 2020-01-30 167 struct rxrpc_call *call = txb->call;
8d94aa381dab19 David Howells 2016-09-07 168 struct msghdr msg;
6a54a9d0ea0f8b David Howells 2020-01-30 169 struct kvec iov[1];
8d94aa381dab19 David Howells 2016-09-07 170 rxrpc_serial_t serial;
805b21b929e291 David Howells 2016-09-24 171 rxrpc_seq_t hard_ack, top;
8d94aa381dab19 David Howells 2016-09-07 172 size_t len, n;
4700c4d80b7bb1 David Howells 2020-08-19 173 int ret, rtt_slot = -1;
8d94aa381dab19 David Howells 2016-09-07 174
5273a191dca65a David Howells 2020-01-30 175 if (test_bit(RXRPC_CALL_DISCONNECTED, &call->flags))
8d94aa381dab19 David Howells 2016-09-07 176 return -ECONNRESET;
8d94aa381dab19 David Howells 2016-09-07 177
5273a191dca65a David Howells 2020-01-30 178 conn = call->conn;
8d94aa381dab19 David Howells 2016-09-07 179
8d94aa381dab19 David Howells 2016-09-07 180 msg.msg_name = &call->peer->srx.transport;
8d94aa381dab19 David Howells 2016-09-07 181 msg.msg_namelen = call->peer->srx.transport_len;
8d94aa381dab19 David Howells 2016-09-07 182 msg.msg_control = NULL;
8d94aa381dab19 David Howells 2016-09-07 183 msg.msg_controllen = 0;
8d94aa381dab19 David Howells 2016-09-07 184 msg.msg_flags = 0;
8d94aa381dab19 David Howells 2016-09-07 185
6a54a9d0ea0f8b David Howells 2020-01-30 186 if (txb->ack.reason == RXRPC_ACK_PING)
6a54a9d0ea0f8b David Howells 2020-01-30 187 txb->wire.flags |= RXRPC_REQUEST_ACK;
8d94aa381dab19 David Howells 2016-09-07 188
8d94aa381dab19 David Howells 2016-09-07 189 spin_lock_bh(&call->lock);
6a54a9d0ea0f8b David Howells 2020-01-30 190 n = rxrpc_fill_out_ack(conn, call, txb, &hard_ack, &top);
8d94aa381dab19 David Howells 2016-09-07 191 spin_unlock_bh(&call->lock);
9a3dedcf18096e David Howells 2022-05-21 192 if (n == 0) {
9a3dedcf18096e David Howells 2022-05-21 @193 kfree(pkt);
Never initialized or used.
9a3dedcf18096e David Howells 2022-05-21 194 return 0;
9a3dedcf18096e David Howells 2022-05-21 195 }
8d94aa381dab19 David Howells 2016-09-07 196
6a54a9d0ea0f8b David Howells 2020-01-30 197 iov[0].iov_base = &txb->wire;
6a54a9d0ea0f8b David Howells 2020-01-30 198 iov[0].iov_len = sizeof(txb->wire) + sizeof(txb->ack) + n;
6a54a9d0ea0f8b David Howells 2020-01-30 199 len = iov[0].iov_len;
8d94aa381dab19 David Howells 2016-09-07 200
b86e218e0d4224 David Howells 2016-09-23 201 serial = atomic_inc_return(&conn->serial);
6a54a9d0ea0f8b David Howells 2020-01-30 202 txb->wire.serial = htonl(serial);
4764c0da69dc50 David Howells 2018-07-23 203 trace_rxrpc_tx_ack(call->debug_id, serial,
6a54a9d0ea0f8b David Howells 2020-01-30 204 ntohl(txb->ack.firstPacket),
6a54a9d0ea0f8b David Howells 2020-01-30 205 ntohl(txb->ack.serial), txb->ack.reason, txb->ack.nAcks);
6a54a9d0ea0f8b David Howells 2020-01-30 206 if (txb->ack_why == rxrpc_propose_ack_ping_for_lost_ack)
6a54a9d0ea0f8b David Howells 2020-01-30 207 call->acks_lost_ping = serial;
b86e218e0d4224 David Howells 2016-09-23 208
6a54a9d0ea0f8b David Howells 2020-01-30 209 if (txb->ack.reason == RXRPC_ACK_PING)
4700c4d80b7bb1 David Howells 2020-08-19 210 rtt_slot = rxrpc_begin_rtt_probe(call, serial, rxrpc_rtt_tx_ping);
26cb02aa6d3efe David Howells 2016-10-06 211
6a54a9d0ea0f8b David Howells 2020-01-30 212 ret = kernel_sendmsg(local->socket, &msg, iov, 1, len);
6a54a9d0ea0f8b David Howells 2020-01-30 213 call->peer->last_tx_at = ktime_get_seconds();
6b47fe1d1ca3ae David Howells 2018-05-10 214 if (ret < 0)
6b47fe1d1ca3ae David Howells 2018-05-10 215 trace_rxrpc_tx_fail(call->debug_id, serial, ret,
4764c0da69dc50 David Howells 2018-07-23 216 rxrpc_tx_point_call_ack);
4764c0da69dc50 David Howells 2018-07-23 217 else
6a54a9d0ea0f8b David Howells 2020-01-30 218 trace_rxrpc_tx_packet(call->debug_id, &txb->wire,
4764c0da69dc50 David Howells 2018-07-23 219 rxrpc_tx_point_call_ack);
c7e86acfcee307 David Howells 2018-11-01 220 rxrpc_tx_backoff(call, ret);
8d94aa381dab19 David Howells 2016-09-07 221
26cb02aa6d3efe David Howells 2016-10-06 222 if (call->state < RXRPC_CALL_COMPLETE) {
6a54a9d0ea0f8b David Howells 2020-01-30 223 if (ret < 0)
4700c4d80b7bb1 David Howells 2020-08-19 224 rxrpc_cancel_rtt_probe(call, serial, rtt_slot);
415f44e43282a1 David Howells 2017-11-24 225 rxrpc_set_keepalive(call);
248f219cb8bcbf David Howells 2016-09-08 226 }
248f219cb8bcbf David Howells 2016-09-08 227
8d94aa381dab19 David Howells 2016-09-07 228 kfree(pkt);
8d94aa381dab19 David Howells 2016-09-07 229 return ret;
8d94aa381dab19 David Howells 2016-09-07 230 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-09-12 14:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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