/* build the data packet containing the data */
msglen = sizeof(struct ds_data_req) + buflen;
- hdr = kzalloc(msglen, GFP_KERNEL);
+ hdr = kzalloc(msglen, GFP_ATOMIC);
if (hdr == NULL) {
pr_err("ds-%llu: %s: failed to alloc mem for data msg.\n",
ds->id, __func__);
dprintk("entered.\n");
- svc_info = kzalloc(sizeof(struct ds_service_info), GFP_KERNEL);
+ svc_info = kzalloc(sizeof(struct ds_service_info), GFP_ATOMIC);
if (unlikely(svc_info == NULL))
return NULL;
- svc_info->id = kmemdup(id, (strlen(id) + 1), GFP_KERNEL);
+ svc_info->id = kmemdup(id, (strlen(id) + 1), GFP_ATOMIC);
svc_info->vers = vers;
svc_info->ops = *ops;
svc_info->is_client = false;
dprintk("entered.\n");
- svc_info = kzalloc(sizeof(struct ds_service_info), GFP_KERNEL);
+ svc_info = kzalloc(sizeof(struct ds_service_info), GFP_ATOMIC);
if (unlikely(svc_info == NULL))
return NULL;
- svc_info->id = kmemdup(id, (strlen(id) + 1), GFP_KERNEL);
+ svc_info->id = kmemdup(id, (strlen(id) + 1), GFP_ATOMIC);
svc_info->vers = vers;
svc_info->ops = *ops;
svc_info->is_client = true;
/* build the data packet containing the data */
msglen = sizeof(struct ds_data_req) + buflen;
- hdr = kzalloc(msglen, GFP_KERNEL);
+ hdr = kzalloc(msglen, GFP_ATOMIC);
if (hdr == NULL) {
pr_err("%s: failed to alloc mem for PRI data msg.\n",
__func__);
ds_add_builtin_services(ds, ds_sp_builtin_template,
ARRAY_SIZE(ds_sp_builtin_template));
- /* add the ds_dev to the global ds_data device list */
- spin_lock_irqsave(&ds_data_lock, flags);
- list_add_tail(&ds->list, &ds_data.ds_dev_list);
- ds_data.num_ds_dev_list++;
- spin_unlock_irqrestore(&ds_data_lock, flags);
-
/*
* begin the process of registering services.
* Note - we do this here to allow loopback services
UNLOCK_DS_DEV(ds, ds_flags)
+ /* add the ds_dev to the global ds_data device list */
+ spin_lock_irqsave(&ds_data_lock, flags);
+ list_add_tail(&ds->list, &ds_data.ds_dev_list);
+ ds_data.num_ds_dev_list++;
+ spin_unlock_irqrestore(&ds_data_lock, flags);
+
return rv;
out_free_ldc: