aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/ar-ack.c14
-rw-r--r--net/rxrpc/ar-key.c6
-rw-r--r--net/rxrpc/ar-output.c4
3 files changed, 11 insertions, 13 deletions
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c
index f99cfce7ca97..c3126e864f3c 100644
--- a/net/rxrpc/ar-ack.c
+++ b/net/rxrpc/ar-ack.c
@@ -195,7 +195,7 @@ static void rxrpc_resend(struct rxrpc_call *call)
195 sp = rxrpc_skb(txb); 195 sp = rxrpc_skb(txb);
196 196
197 if (sp->need_resend) { 197 if (sp->need_resend) {
198 sp->need_resend = 0; 198 sp->need_resend = false;
199 199
200 /* each Tx packet has a new serial number */ 200 /* each Tx packet has a new serial number */
201 sp->hdr.serial = 201 sp->hdr.serial =
@@ -216,7 +216,7 @@ static void rxrpc_resend(struct rxrpc_call *call)
216 } 216 }
217 217
218 if (time_after_eq(jiffies + 1, sp->resend_at)) { 218 if (time_after_eq(jiffies + 1, sp->resend_at)) {
219 sp->need_resend = 1; 219 sp->need_resend = true;
220 resend |= 1; 220 resend |= 1;
221 } else if (resend & 2) { 221 } else if (resend & 2) {
222 if (time_before(sp->resend_at, resend_at)) 222 if (time_before(sp->resend_at, resend_at))
@@ -265,7 +265,7 @@ static void rxrpc_resend_timer(struct rxrpc_call *call)
265 if (sp->need_resend) { 265 if (sp->need_resend) {
266 ; 266 ;
267 } else if (time_after_eq(jiffies + 1, sp->resend_at)) { 267 } else if (time_after_eq(jiffies + 1, sp->resend_at)) {
268 sp->need_resend = 1; 268 sp->need_resend = true;
269 resend |= 1; 269 resend |= 1;
270 } else if (resend & 2) { 270 } else if (resend & 2) {
271 if (time_before(sp->resend_at, resend_at)) 271 if (time_before(sp->resend_at, resend_at))
@@ -314,11 +314,11 @@ static int rxrpc_process_soft_ACKs(struct rxrpc_call *call,
314 314
315 switch (sacks[loop]) { 315 switch (sacks[loop]) {
316 case RXRPC_ACK_TYPE_ACK: 316 case RXRPC_ACK_TYPE_ACK:
317 sp->need_resend = 0; 317 sp->need_resend = false;
318 *p_txb |= 1; 318 *p_txb |= 1;
319 break; 319 break;
320 case RXRPC_ACK_TYPE_NACK: 320 case RXRPC_ACK_TYPE_NACK:
321 sp->need_resend = 1; 321 sp->need_resend = true;
322 *p_txb &= ~1; 322 *p_txb &= ~1;
323 resend = 1; 323 resend = 1;
324 break; 324 break;
@@ -344,13 +344,13 @@ static int rxrpc_process_soft_ACKs(struct rxrpc_call *call,
344 344
345 if (*p_txb & 1) { 345 if (*p_txb & 1) {
346 /* packet must have been discarded */ 346 /* packet must have been discarded */
347 sp->need_resend = 1; 347 sp->need_resend = true;
348 *p_txb &= ~1; 348 *p_txb &= ~1;
349 resend |= 1; 349 resend |= 1;
350 } else if (sp->need_resend) { 350 } else if (sp->need_resend) {
351 ; 351 ;
352 } else if (time_after_eq(jiffies + 1, sp->resend_at)) { 352 } else if (time_after_eq(jiffies + 1, sp->resend_at)) {
353 sp->need_resend = 1; 353 sp->need_resend = true;
354 resend |= 1; 354 resend |= 1;
355 } else if (resend & 2) { 355 } else if (resend & 2) {
356 if (time_before(sp->resend_at, resend_at)) 356 if (time_before(sp->resend_at, resend_at))
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c
index 43ea7de2fc8e..4cba13e46ffd 100644
--- a/net/rxrpc/ar-key.c
+++ b/net/rxrpc/ar-key.c
@@ -306,10 +306,9 @@ static int rxrpc_krb5_decode_tagged_data(struct krb5_tagged_data *td,
306 td->data_len = len; 306 td->data_len = len;
307 307
308 if (len > 0) { 308 if (len > 0) {
309 td->data = kmalloc(len, GFP_KERNEL); 309 td->data = kmemdup(xdr, len, GFP_KERNEL);
310 if (!td->data) 310 if (!td->data)
311 return -ENOMEM; 311 return -ENOMEM;
312 memcpy(td->data, xdr, len);
313 len = (len + 3) & ~3; 312 len = (len + 3) & ~3;
314 toklen -= len; 313 toklen -= len;
315 xdr += len >> 2; 314 xdr += len >> 2;
@@ -401,10 +400,9 @@ static int rxrpc_krb5_decode_ticket(u8 **_ticket, u16 *_tktlen,
401 _debug("ticket len %u", len); 400 _debug("ticket len %u", len);
402 401
403 if (len > 0) { 402 if (len > 0) {
404 *_ticket = kmalloc(len, GFP_KERNEL); 403 *_ticket = kmemdup(xdr, len, GFP_KERNEL);
405 if (!*_ticket) 404 if (!*_ticket)
406 return -ENOMEM; 405 return -ENOMEM;
407 memcpy(*_ticket, xdr, len);
408 len = (len + 3) & ~3; 406 len = (len + 3) & ~3;
409 toklen -= len; 407 toklen -= len;
410 xdr += len >> 2; 408 xdr += len >> 2;
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index 338d793c7113..16ae88762d00 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -486,7 +486,7 @@ static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
486 _proto("Tx DATA %%%u { #%u }", 486 _proto("Tx DATA %%%u { #%u }",
487 ntohl(sp->hdr.serial), ntohl(sp->hdr.seq)); 487 ntohl(sp->hdr.serial), ntohl(sp->hdr.seq));
488 488
489 sp->need_resend = 0; 489 sp->need_resend = false;
490 sp->resend_at = jiffies + rxrpc_resend_timeout * HZ; 490 sp->resend_at = jiffies + rxrpc_resend_timeout * HZ;
491 if (!test_and_set_bit(RXRPC_CALL_RUN_RTIMER, &call->flags)) { 491 if (!test_and_set_bit(RXRPC_CALL_RUN_RTIMER, &call->flags)) {
492 _debug("run timer"); 492 _debug("run timer");
@@ -508,7 +508,7 @@ static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
508 508
509 if (ret < 0) { 509 if (ret < 0) {
510 _debug("need instant resend %d", ret); 510 _debug("need instant resend %d", ret);
511 sp->need_resend = 1; 511 sp->need_resend = true;
512 rxrpc_instant_resend(call); 512 rxrpc_instant_resend(call);
513 } 513 }
514 514