OLD | NEW |
1 /* | 1 /* |
2 * This file implement the Wireless Extensions priv API. | 2 * This file implement the Wireless Extensions priv API. |
3 * | 3 * |
4 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 4 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
5 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. | 5 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. |
6 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> | 6 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> |
7 * | 7 * |
8 * (As all part of the Linux kernel, this file is GPL) | 8 * (As all part of the Linux kernel, this file is GPL) |
9 */ | 9 */ |
10 #include <linux/slab.h> | 10 #include <linux/slab.h> |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 /* Check what user space is giving us */ | 145 /* Check what user space is giving us */ |
146 if (IW_IS_SET(cmd)) { | 146 if (IW_IS_SET(cmd)) { |
147 if (!iwp->pointer && iwp->length != 0) | 147 if (!iwp->pointer && iwp->length != 0) |
148 return -EFAULT; | 148 return -EFAULT; |
149 | 149 |
150 if (iwp->length > (descr->set_args & IW_PRIV_SIZE_MASK)) | 150 if (iwp->length > (descr->set_args & IW_PRIV_SIZE_MASK)) |
151 return -E2BIG; | 151 return -E2BIG; |
152 } else if (!iwp->pointer) | 152 } else if (!iwp->pointer) |
153 return -EFAULT; | 153 return -EFAULT; |
154 | 154 |
155 » extra = kmalloc(extra_size, GFP_KERNEL); | 155 » extra = kzalloc(extra_size, GFP_KERNEL); |
156 if (!extra) | 156 if (!extra) |
157 return -ENOMEM; | 157 return -ENOMEM; |
158 | 158 |
159 /* If it is a SET, get all the extra data in here */ | 159 /* If it is a SET, get all the extra data in here */ |
160 if (IW_IS_SET(cmd) && (iwp->length != 0)) { | 160 if (IW_IS_SET(cmd) && (iwp->length != 0)) { |
161 if (copy_from_user(extra, iwp->pointer, extra_size)) { | 161 if (copy_from_user(extra, iwp->pointer, extra_size)) { |
162 err = -EFAULT; | 162 err = -EFAULT; |
163 goto out; | 163 goto out; |
164 } | 164 } |
165 } | 165 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 iwp_compat->flags = iwp.flags; | 240 iwp_compat->flags = iwp.flags; |
241 } | 241 } |
242 | 242 |
243 /* Call commit handler if needed and defined */ | 243 /* Call commit handler if needed and defined */ |
244 if (ret == -EIWCOMMIT) | 244 if (ret == -EIWCOMMIT) |
245 ret = call_commit_handler(dev); | 245 ret = call_commit_handler(dev); |
246 | 246 |
247 return ret; | 247 return ret; |
248 } | 248 } |
249 #endif | 249 #endif |
OLD | NEW |