Just in case dev->name is ever not NUL terminated
unsigned int cmd, unsigned long arg)
{
struct elmcan *elm = get_elm(tty);
- unsigned int tmp;
if (!elm)
return -EINVAL;
switch (cmd) {
case SIOCGIFNAME:
- tmp = strlen(elm->dev->name) + 1;
- if (copy_to_user((void __user *)arg, elm->dev->name, tmp)) {
+ if (copy_to_user((void __user *)arg, elm->dev->name, IFNAMSIZ)) {
put_elm(elm);
return -EFAULT;
}