bebob_hwdep.c (58f7553fa424fd0fd74e8b796d50c66014cebebe) | bebob_hwdep.c (75b1a8f9d62e50f05d0e4e9f3c8bcde32527ffc1) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * bebob_hwdep.c - a part of driver for BeBoB based devices 4 * 5 * Copyright (c) 2013-2014 Takashi Sakamoto 6 */ 7 8/* --- 66 unchanged lines hidden (view full) --- 75 struct fw_device *dev = fw_parent_device(bebob->unit); 76 struct snd_firewire_get_info info; 77 78 memset(&info, 0, sizeof(info)); 79 info.type = SNDRV_FIREWIRE_TYPE_BEBOB; 80 info.card = dev->card->index; 81 *(__be32 *)&info.guid[0] = cpu_to_be32(dev->config_rom[3]); 82 *(__be32 *)&info.guid[4] = cpu_to_be32(dev->config_rom[4]); | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * bebob_hwdep.c - a part of driver for BeBoB based devices 4 * 5 * Copyright (c) 2013-2014 Takashi Sakamoto 6 */ 7 8/* --- 66 unchanged lines hidden (view full) --- 75 struct fw_device *dev = fw_parent_device(bebob->unit); 76 struct snd_firewire_get_info info; 77 78 memset(&info, 0, sizeof(info)); 79 info.type = SNDRV_FIREWIRE_TYPE_BEBOB; 80 info.card = dev->card->index; 81 *(__be32 *)&info.guid[0] = cpu_to_be32(dev->config_rom[3]); 82 *(__be32 *)&info.guid[4] = cpu_to_be32(dev->config_rom[4]); |
83 strlcpy(info.device_name, dev_name(&dev->device), | 83 strscpy(info.device_name, dev_name(&dev->device), |
84 sizeof(info.device_name)); 85 86 if (copy_to_user(arg, &info, sizeof(info))) 87 return -EFAULT; 88 89 return 0; 90} 91 --- 105 unchanged lines hidden --- | 84 sizeof(info.device_name)); 85 86 if (copy_to_user(arg, &info, sizeof(info))) 87 return -EFAULT; 88 89 return 0; 90} 91 --- 105 unchanged lines hidden --- |