diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/atm/lec.c | 3 | ||||
-rw-r--r-- | net/bridge/netfilter/ebtables.c | 4 | ||||
-rw-r--r-- | net/core/dev_mcast.c | 2 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 15 | ||||
-rw-r--r-- | net/ipv4/ip_sockglue.c | 6 | ||||
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 11 | ||||
-rw-r--r-- | net/irda/irias_object.c | 12 | ||||
-rw-r--r-- | net/packet/af_packet.c | 2 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 2 | ||||
-rw-r--r-- | net/sctp/socket.c | 4 | ||||
-rw-r--r-- | net/socket.c | 2 | ||||
-rw-r--r-- | net/sunrpc/auth.c | 2 | ||||
-rw-r--r-- | net/sunrpc/auth_unix.c | 2 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 4 | ||||
-rw-r--r-- | net/sunrpc/svc.c | 2 |
16 files changed, 34 insertions, 41 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c index eea051338498..93ce390996c7 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -1811,8 +1811,7 @@ make_entry(struct lec_priv *priv, unsigned char *mac_addr) | |||
1811 | { | 1811 | { |
1812 | struct lec_arp_table *to_return; | 1812 | struct lec_arp_table *to_return; |
1813 | 1813 | ||
1814 | to_return = (struct lec_arp_table *) kmalloc(sizeof(struct lec_arp_table), | 1814 | to_return = kmalloc(sizeof(struct lec_arp_table), GFP_ATOMIC); |
1815 | GFP_ATOMIC); | ||
1816 | if (!to_return) { | 1815 | if (!to_return) { |
1817 | printk("LEC: Arp entry kmalloc failed\n"); | 1816 | printk("LEC: Arp entry kmalloc failed\n"); |
1818 | return NULL; | 1817 | return NULL; |
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index f8ffbf6e2333..00729b3604f8 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
@@ -944,7 +944,7 @@ static int do_replace(void __user *user, unsigned int len) | |||
944 | if (countersize) | 944 | if (countersize) |
945 | memset(newinfo->counters, 0, countersize); | 945 | memset(newinfo->counters, 0, countersize); |
946 | 946 | ||
947 | newinfo->entries = (char *)vmalloc(tmp.entries_size); | 947 | newinfo->entries = vmalloc(tmp.entries_size); |
948 | if (!newinfo->entries) { | 948 | if (!newinfo->entries) { |
949 | ret = -ENOMEM; | 949 | ret = -ENOMEM; |
950 | goto free_newinfo; | 950 | goto free_newinfo; |
@@ -1146,7 +1146,7 @@ int ebt_register_table(struct ebt_table *table) | |||
1146 | if (!newinfo) | 1146 | if (!newinfo) |
1147 | return -ENOMEM; | 1147 | return -ENOMEM; |
1148 | 1148 | ||
1149 | newinfo->entries = (char *)vmalloc(table->table->entries_size); | 1149 | newinfo->entries = vmalloc(table->table->entries_size); |
1150 | if (!(newinfo->entries)) | 1150 | if (!(newinfo->entries)) |
1151 | goto free_newinfo; | 1151 | goto free_newinfo; |
1152 | 1152 | ||
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index cb530eef0e39..05d60850840e 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
@@ -158,7 +158,7 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) | |||
158 | int err = 0; | 158 | int err = 0; |
159 | struct dev_mc_list *dmi, *dmi1; | 159 | struct dev_mc_list *dmi, *dmi1; |
160 | 160 | ||
161 | dmi1 = (struct dev_mc_list *)kmalloc(sizeof(*dmi), GFP_ATOMIC); | 161 | dmi1 = kmalloc(sizeof(*dmi), GFP_ATOMIC); |
162 | 162 | ||
163 | spin_lock_bh(&dev->xmit_lock); | 163 | spin_lock_bh(&dev->xmit_lock); |
164 | for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { | 164 | for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 34758118c10c..192092b89e53 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -975,7 +975,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im) | |||
975 | * for deleted items allows change reports to use common code with | 975 | * for deleted items allows change reports to use common code with |
976 | * non-deleted or query-response MCA's. | 976 | * non-deleted or query-response MCA's. |
977 | */ | 977 | */ |
978 | pmc = (struct ip_mc_list *)kmalloc(sizeof(*pmc), GFP_KERNEL); | 978 | pmc = kmalloc(sizeof(*pmc), GFP_KERNEL); |
979 | if (!pmc) | 979 | if (!pmc) |
980 | return; | 980 | return; |
981 | memset(pmc, 0, sizeof(*pmc)); | 981 | memset(pmc, 0, sizeof(*pmc)); |
@@ -1155,7 +1155,7 @@ void ip_mc_inc_group(struct in_device *in_dev, u32 addr) | |||
1155 | } | 1155 | } |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | im = (struct ip_mc_list *)kmalloc(sizeof(*im), GFP_KERNEL); | 1158 | im = kmalloc(sizeof(*im), GFP_KERNEL); |
1159 | if (!im) | 1159 | if (!im) |
1160 | goto out; | 1160 | goto out; |
1161 | 1161 | ||
@@ -1476,7 +1476,7 @@ static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, | |||
1476 | psf_prev = psf; | 1476 | psf_prev = psf; |
1477 | } | 1477 | } |
1478 | if (!psf) { | 1478 | if (!psf) { |
1479 | psf = (struct ip_sf_list *)kmalloc(sizeof(*psf), GFP_ATOMIC); | 1479 | psf = kmalloc(sizeof(*psf), GFP_ATOMIC); |
1480 | if (!psf) | 1480 | if (!psf) |
1481 | return -ENOBUFS; | 1481 | return -ENOBUFS; |
1482 | memset(psf, 0, sizeof(*psf)); | 1482 | memset(psf, 0, sizeof(*psf)); |
@@ -1659,7 +1659,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr) | |||
1659 | err = -ENOBUFS; | 1659 | err = -ENOBUFS; |
1660 | if (count >= sysctl_igmp_max_memberships) | 1660 | if (count >= sysctl_igmp_max_memberships) |
1661 | goto done; | 1661 | goto done; |
1662 | iml = (struct ip_mc_socklist *)sock_kmalloc(sk,sizeof(*iml),GFP_KERNEL); | 1662 | iml = sock_kmalloc(sk,sizeof(*iml),GFP_KERNEL); |
1663 | if (iml == NULL) | 1663 | if (iml == NULL) |
1664 | goto done; | 1664 | goto done; |
1665 | 1665 | ||
@@ -1823,8 +1823,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct | |||
1823 | 1823 | ||
1824 | if (psl) | 1824 | if (psl) |
1825 | count += psl->sl_max; | 1825 | count += psl->sl_max; |
1826 | newpsl = (struct ip_sf_socklist *)sock_kmalloc(sk, | 1826 | newpsl = sock_kmalloc(sk, IP_SFLSIZE(count), GFP_KERNEL); |
1827 | IP_SFLSIZE(count), GFP_KERNEL); | ||
1828 | if (!newpsl) { | 1827 | if (!newpsl) { |
1829 | err = -ENOBUFS; | 1828 | err = -ENOBUFS; |
1830 | goto done; | 1829 | goto done; |
@@ -1907,8 +1906,8 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) | |||
1907 | goto done; | 1906 | goto done; |
1908 | } | 1907 | } |
1909 | if (msf->imsf_numsrc) { | 1908 | if (msf->imsf_numsrc) { |
1910 | newpsl = (struct ip_sf_socklist *)sock_kmalloc(sk, | 1909 | newpsl = sock_kmalloc(sk, IP_SFLSIZE(msf->imsf_numsrc), |
1911 | IP_SFLSIZE(msf->imsf_numsrc), GFP_KERNEL); | 1910 | GFP_KERNEL); |
1912 | if (!newpsl) { | 1911 | if (!newpsl) { |
1913 | err = -ENOBUFS; | 1912 | err = -ENOBUFS; |
1914 | goto done; | 1913 | goto done; |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 6986e11d65cc..2bf8d782f678 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -621,7 +621,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, | |||
621 | err = -ENOBUFS; | 621 | err = -ENOBUFS; |
622 | break; | 622 | break; |
623 | } | 623 | } |
624 | msf = (struct ip_msfilter *)kmalloc(optlen, GFP_KERNEL); | 624 | msf = kmalloc(optlen, GFP_KERNEL); |
625 | if (msf == 0) { | 625 | if (msf == 0) { |
626 | err = -ENOBUFS; | 626 | err = -ENOBUFS; |
627 | break; | 627 | break; |
@@ -778,7 +778,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, | |||
778 | err = -ENOBUFS; | 778 | err = -ENOBUFS; |
779 | break; | 779 | break; |
780 | } | 780 | } |
781 | gsf = (struct group_filter *)kmalloc(optlen,GFP_KERNEL); | 781 | gsf = kmalloc(optlen,GFP_KERNEL); |
782 | if (gsf == 0) { | 782 | if (gsf == 0) { |
783 | err = -ENOBUFS; | 783 | err = -ENOBUFS; |
784 | break; | 784 | break; |
@@ -798,7 +798,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, | |||
798 | goto mc_msf_out; | 798 | goto mc_msf_out; |
799 | } | 799 | } |
800 | msize = IP_MSFILTER_SIZE(gsf->gf_numsrc); | 800 | msize = IP_MSFILTER_SIZE(gsf->gf_numsrc); |
801 | msf = (struct ip_msfilter *)kmalloc(msize,GFP_KERNEL); | 801 | msf = kmalloc(msize,GFP_KERNEL); |
802 | if (msf == 0) { | 802 | if (msf == 0) { |
803 | err = -ENOBUFS; | 803 | err = -ENOBUFS; |
804 | goto mc_msf_out; | 804 | goto mc_msf_out; |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index c63868dd2ca2..5eac9318320e 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -549,7 +549,7 @@ done: | |||
549 | retv = -ENOBUFS; | 549 | retv = -ENOBUFS; |
550 | break; | 550 | break; |
551 | } | 551 | } |
552 | gsf = (struct group_filter *)kmalloc(optlen,GFP_KERNEL); | 552 | gsf = kmalloc(optlen,GFP_KERNEL); |
553 | if (gsf == 0) { | 553 | if (gsf == 0) { |
554 | retv = -ENOBUFS; | 554 | retv = -ENOBUFS; |
555 | break; | 555 | break; |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 1cf305a9f8dd..cc3e9f560867 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -449,8 +449,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk, | |||
449 | 449 | ||
450 | if (psl) | 450 | if (psl) |
451 | count += psl->sl_max; | 451 | count += psl->sl_max; |
452 | newpsl = (struct ip6_sf_socklist *)sock_kmalloc(sk, | 452 | newpsl = sock_kmalloc(sk, IP6_SFLSIZE(count), GFP_ATOMIC); |
453 | IP6_SFLSIZE(count), GFP_ATOMIC); | ||
454 | if (!newpsl) { | 453 | if (!newpsl) { |
455 | err = -ENOBUFS; | 454 | err = -ENOBUFS; |
456 | goto done; | 455 | goto done; |
@@ -535,8 +534,8 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf) | |||
535 | goto done; | 534 | goto done; |
536 | } | 535 | } |
537 | if (gsf->gf_numsrc) { | 536 | if (gsf->gf_numsrc) { |
538 | newpsl = (struct ip6_sf_socklist *)sock_kmalloc(sk, | 537 | newpsl = sock_kmalloc(sk, IP6_SFLSIZE(gsf->gf_numsrc), |
539 | IP6_SFLSIZE(gsf->gf_numsrc), GFP_ATOMIC); | 538 | GFP_ATOMIC); |
540 | if (!newpsl) { | 539 | if (!newpsl) { |
541 | err = -ENOBUFS; | 540 | err = -ENOBUFS; |
542 | goto done; | 541 | goto done; |
@@ -768,7 +767,7 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im) | |||
768 | * for deleted items allows change reports to use common code with | 767 | * for deleted items allows change reports to use common code with |
769 | * non-deleted or query-response MCA's. | 768 | * non-deleted or query-response MCA's. |
770 | */ | 769 | */ |
771 | pmc = (struct ifmcaddr6 *)kmalloc(sizeof(*pmc), GFP_ATOMIC); | 770 | pmc = kmalloc(sizeof(*pmc), GFP_ATOMIC); |
772 | if (!pmc) | 771 | if (!pmc) |
773 | return; | 772 | return; |
774 | memset(pmc, 0, sizeof(*pmc)); | 773 | memset(pmc, 0, sizeof(*pmc)); |
@@ -1937,7 +1936,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode, | |||
1937 | psf_prev = psf; | 1936 | psf_prev = psf; |
1938 | } | 1937 | } |
1939 | if (!psf) { | 1938 | if (!psf) { |
1940 | psf = (struct ip6_sf_list *)kmalloc(sizeof(*psf), GFP_ATOMIC); | 1939 | psf = kmalloc(sizeof(*psf), GFP_ATOMIC); |
1941 | if (!psf) | 1940 | if (!psf) |
1942 | return -ENOBUFS; | 1941 | return -ENOBUFS; |
1943 | memset(psf, 0, sizeof(*psf)); | 1942 | memset(psf, 0, sizeof(*psf)); |
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 75f2666e8630..c6d169fbdceb 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
@@ -82,8 +82,7 @@ struct ias_object *irias_new_object( char *name, int id) | |||
82 | 82 | ||
83 | IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); | 83 | IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); |
84 | 84 | ||
85 | obj = (struct ias_object *) kmalloc(sizeof(struct ias_object), | 85 | obj = kmalloc(sizeof(struct ias_object), GFP_ATOMIC); |
86 | GFP_ATOMIC); | ||
87 | if (obj == NULL) { | 86 | if (obj == NULL) { |
88 | IRDA_WARNING("%s(), Unable to allocate object!\n", | 87 | IRDA_WARNING("%s(), Unable to allocate object!\n", |
89 | __FUNCTION__); | 88 | __FUNCTION__); |
@@ -348,8 +347,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, | |||
348 | IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); | 347 | IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); |
349 | IRDA_ASSERT(name != NULL, return;); | 348 | IRDA_ASSERT(name != NULL, return;); |
350 | 349 | ||
351 | attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), | 350 | attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); |
352 | GFP_ATOMIC); | ||
353 | if (attrib == NULL) { | 351 | if (attrib == NULL) { |
354 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 352 | IRDA_WARNING("%s: Unable to allocate attribute!\n", |
355 | __FUNCTION__); | 353 | __FUNCTION__); |
@@ -385,8 +383,7 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, | |||
385 | IRDA_ASSERT(name != NULL, return;); | 383 | IRDA_ASSERT(name != NULL, return;); |
386 | IRDA_ASSERT(octets != NULL, return;); | 384 | IRDA_ASSERT(octets != NULL, return;); |
387 | 385 | ||
388 | attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), | 386 | attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); |
389 | GFP_ATOMIC); | ||
390 | if (attrib == NULL) { | 387 | if (attrib == NULL) { |
391 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 388 | IRDA_WARNING("%s: Unable to allocate attribute!\n", |
392 | __FUNCTION__); | 389 | __FUNCTION__); |
@@ -420,8 +417,7 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, | |||
420 | IRDA_ASSERT(name != NULL, return;); | 417 | IRDA_ASSERT(name != NULL, return;); |
421 | IRDA_ASSERT(value != NULL, return;); | 418 | IRDA_ASSERT(value != NULL, return;); |
422 | 419 | ||
423 | attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib), | 420 | attrib = kmalloc(sizeof( struct ias_attrib), GFP_ATOMIC); |
424 | GFP_ATOMIC); | ||
425 | if (attrib == NULL) { | 421 | if (attrib == NULL) { |
426 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 422 | IRDA_WARNING("%s: Unable to allocate attribute!\n", |
427 | __FUNCTION__); | 423 | __FUNCTION__); |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index f69e5ed9bd06..c6ee29f8eec0 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -1237,7 +1237,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq) | |||
1237 | goto done; | 1237 | goto done; |
1238 | 1238 | ||
1239 | err = -ENOBUFS; | 1239 | err = -ENOBUFS; |
1240 | i = (struct packet_mclist *)kmalloc(sizeof(*i), GFP_KERNEL); | 1240 | i = kmalloc(sizeof(*i), GFP_KERNEL); |
1241 | if (i == NULL) | 1241 | if (i == NULL) |
1242 | goto done; | 1242 | goto done; |
1243 | 1243 | ||
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index f9573eba5c7a..556c495c6922 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -1287,7 +1287,7 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, | |||
1287 | - (bodysize % SCTP_COOKIE_MULTIPLE); | 1287 | - (bodysize % SCTP_COOKIE_MULTIPLE); |
1288 | *cookie_len = headersize + bodysize; | 1288 | *cookie_len = headersize + bodysize; |
1289 | 1289 | ||
1290 | retval = (sctp_cookie_param_t *)kmalloc(*cookie_len, GFP_ATOMIC); | 1290 | retval = kmalloc(*cookie_len, GFP_ATOMIC); |
1291 | 1291 | ||
1292 | if (!retval) { | 1292 | if (!retval) { |
1293 | *cookie_len = 0; | 1293 | *cookie_len = 0; |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index fc04d185fa33..a268eab68ca1 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -860,7 +860,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk, | |||
860 | return -EFAULT; | 860 | return -EFAULT; |
861 | 861 | ||
862 | /* Alloc space for the address array in kernel memory. */ | 862 | /* Alloc space for the address array in kernel memory. */ |
863 | kaddrs = (struct sockaddr *)kmalloc(addrs_size, GFP_KERNEL); | 863 | kaddrs = kmalloc(addrs_size, GFP_KERNEL); |
864 | if (unlikely(!kaddrs)) | 864 | if (unlikely(!kaddrs)) |
865 | return -ENOMEM; | 865 | return -ENOMEM; |
866 | 866 | ||
@@ -1150,7 +1150,7 @@ SCTP_STATIC int sctp_setsockopt_connectx(struct sock* sk, | |||
1150 | return -EFAULT; | 1150 | return -EFAULT; |
1151 | 1151 | ||
1152 | /* Alloc space for the address array in kernel memory. */ | 1152 | /* Alloc space for the address array in kernel memory. */ |
1153 | kaddrs = (struct sockaddr *)kmalloc(addrs_size, GFP_KERNEL); | 1153 | kaddrs = kmalloc(addrs_size, GFP_KERNEL); |
1154 | if (unlikely(!kaddrs)) | 1154 | if (unlikely(!kaddrs)) |
1155 | return -ENOMEM; | 1155 | return -ENOMEM; |
1156 | 1156 | ||
diff --git a/net/socket.c b/net/socket.c index 06fa217f58a9..b38a263853c3 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -993,7 +993,7 @@ static int sock_fasync(int fd, struct file *filp, int on) | |||
993 | 993 | ||
994 | if (on) | 994 | if (on) |
995 | { | 995 | { |
996 | fna=(struct fasync_struct *)kmalloc(sizeof(struct fasync_struct), GFP_KERNEL); | 996 | fna = kmalloc(sizeof(struct fasync_struct), GFP_KERNEL); |
997 | if(fna==NULL) | 997 | if(fna==NULL) |
998 | return -ENOMEM; | 998 | return -ENOMEM; |
999 | } | 999 | } |
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 8c7756036e95..9ac1b8c26c01 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
@@ -94,7 +94,7 @@ rpcauth_init_credcache(struct rpc_auth *auth, unsigned long expire) | |||
94 | struct rpc_cred_cache *new; | 94 | struct rpc_cred_cache *new; |
95 | int i; | 95 | int i; |
96 | 96 | ||
97 | new = (struct rpc_cred_cache *)kmalloc(sizeof(*new), GFP_KERNEL); | 97 | new = kmalloc(sizeof(*new), GFP_KERNEL); |
98 | if (!new) | 98 | if (!new) |
99 | return -ENOMEM; | 99 | return -ENOMEM; |
100 | for (i = 0; i < RPC_CREDCACHE_NR; i++) | 100 | for (i = 0; i < RPC_CREDCACHE_NR; i++) |
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 890fb5ea0dcb..1b3ed4fd1987 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c | |||
@@ -70,7 +70,7 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) | |||
70 | dprintk("RPC: allocating UNIX cred for uid %d gid %d\n", | 70 | dprintk("RPC: allocating UNIX cred for uid %d gid %d\n", |
71 | acred->uid, acred->gid); | 71 | acred->uid, acred->gid); |
72 | 72 | ||
73 | if (!(cred = (struct unx_cred *) kmalloc(sizeof(*cred), GFP_KERNEL))) | 73 | if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL))) |
74 | return ERR_PTR(-ENOMEM); | 74 | return ERR_PTR(-ENOMEM); |
75 | 75 | ||
76 | atomic_set(&cred->uc_count, 1); | 76 | atomic_set(&cred->uc_count, 1); |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 4cef7fa2b740..d2f0550c4ba0 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -118,7 +118,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, | |||
118 | goto out_err; | 118 | goto out_err; |
119 | 119 | ||
120 | err = -ENOMEM; | 120 | err = -ENOMEM; |
121 | clnt = (struct rpc_clnt *) kmalloc(sizeof(*clnt), GFP_KERNEL); | 121 | clnt = kmalloc(sizeof(*clnt), GFP_KERNEL); |
122 | if (!clnt) | 122 | if (!clnt) |
123 | goto out_err; | 123 | goto out_err; |
124 | memset(clnt, 0, sizeof(*clnt)); | 124 | memset(clnt, 0, sizeof(*clnt)); |
@@ -225,7 +225,7 @@ rpc_clone_client(struct rpc_clnt *clnt) | |||
225 | { | 225 | { |
226 | struct rpc_clnt *new; | 226 | struct rpc_clnt *new; |
227 | 227 | ||
228 | new = (struct rpc_clnt *)kmalloc(sizeof(*new), GFP_KERNEL); | 228 | new = kmalloc(sizeof(*new), GFP_KERNEL); |
229 | if (!new) | 229 | if (!new) |
230 | goto out_no_clnt; | 230 | goto out_no_clnt; |
231 | memcpy(new, clnt, sizeof(*new)); | 231 | memcpy(new, clnt, sizeof(*new)); |
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index a8bd34d47425..b08419e1fc68 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -32,7 +32,7 @@ svc_create(struct svc_program *prog, unsigned int bufsize) | |||
32 | int vers; | 32 | int vers; |
33 | unsigned int xdrsize; | 33 | unsigned int xdrsize; |
34 | 34 | ||
35 | if (!(serv = (struct svc_serv *) kmalloc(sizeof(*serv), GFP_KERNEL))) | 35 | if (!(serv = kmalloc(sizeof(*serv), GFP_KERNEL))) |
36 | return NULL; | 36 | return NULL; |
37 | memset(serv, 0, sizeof(*serv)); | 37 | memset(serv, 0, sizeof(*serv)); |
38 | serv->sv_name = prog->pg_name; | 38 | serv->sv_name = prog->pg_name; |