aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/iriap.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/iriap.c')
-rw-r--r--net/irda/iriap.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 415cf4eec23b..8cfd076c4c12 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -172,7 +172,7 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
172 172
173 IRDA_DEBUG(2, "%s()\n", __FUNCTION__); 173 IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
174 174
175 self = kmalloc(sizeof(struct iriap_cb), GFP_ATOMIC); 175 self = kzalloc(sizeof(*self), GFP_ATOMIC);
176 if (!self) { 176 if (!self) {
177 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); 177 IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
178 return NULL; 178 return NULL;
@@ -181,7 +181,6 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
181 /* 181 /*
182 * Initialize instance 182 * Initialize instance
183 */ 183 */
184 memset(self, 0, sizeof(struct iriap_cb));
185 184
186 self->magic = IAS_MAGIC; 185 self->magic = IAS_MAGIC;
187 self->mode = mode; 186 self->mode = mode;
@@ -451,12 +450,12 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
451 n = 2; 450 n = 2;
452 451
453 /* Get length, MSB first */ 452 /* Get length, MSB first */
454 len = be16_to_cpu(get_unaligned((__u16 *)(fp+n))); n += 2; 453 len = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2;
455 454
456 IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len); 455 IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
457 456
458 /* Get object ID, MSB first */ 457 /* Get object ID, MSB first */
459 obj_id = be16_to_cpu(get_unaligned((__u16 *)(fp+n))); n += 2; 458 obj_id = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2;
460 459
461 type = fp[n++]; 460 type = fp[n++];
462 IRDA_DEBUG(4, "%s(), Value type = %d\n", __FUNCTION__, type); 461 IRDA_DEBUG(4, "%s(), Value type = %d\n", __FUNCTION__, type);
@@ -506,7 +505,7 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
506 value = irias_new_string_value(fp+n); 505 value = irias_new_string_value(fp+n);
507 break; 506 break;
508 case IAS_OCT_SEQ: 507 case IAS_OCT_SEQ:
509 value_len = be16_to_cpu(get_unaligned((__u16 *)(fp+n))); 508 value_len = be16_to_cpu(get_unaligned((__be16 *)(fp+n)));
510 n += 2; 509 n += 2;
511 510
512 /* Will truncate to IAS_MAX_OCTET_STRING bytes */ 511 /* Will truncate to IAS_MAX_OCTET_STRING bytes */
@@ -544,7 +543,7 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self,
544{ 543{
545 struct sk_buff *tx_skb; 544 struct sk_buff *tx_skb;
546 int n; 545 int n;
547 __u32 tmp_be32; 546 __be32 tmp_be32;
548 __be16 tmp_be16; 547 __be16 tmp_be16;
549 __u8 *fp; 548 __u8 *fp;
550 549