struct smscore_registry_entry_t {
struct list_head entry;
- char devpath[32];
- int mode;
+ char devpath[32];
+ int mode;
enum sms_device_type_st type;
};
next != &g_smscore_registry;
next = next->next) {
entry = (struct smscore_registry_entry_t *) next;
- if (!strcmp(entry->devpath, devpath)) {
+ if (!strncmp(entry->devpath, devpath, sizeof(entry->devpath))) {
kmutex_unlock(&g_smscore_registrylock);
return entry;
}
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
if (entry) {
entry->mode = default_mode;
- strcpy(entry->devpath, devpath);
+ strlcpy(entry->devpath, devpath, sizeof(entry->devpath));
list_add(&entry->entry, &g_smscore_registry);
} else
pr_err("failed to create smscore_registry.\n");
dev->postload_handler = params->postload_handler;
dev->device_flags = params->flags;
- strcpy(dev->devpath, params->devpath);
+ strlcpy(dev->devpath, params->devpath, sizeof(dev->devpath));
smscore_registry_settype(dev->devpath, params->device_type);