summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rapidio/rio.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index b9dc932ce19e..90534365e46c 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -110,9 +110,8 @@ EXPORT_SYMBOL(rio_query_mport);
110 */ 110 */
111struct rio_net *rio_alloc_net(struct rio_mport *mport) 111struct rio_net *rio_alloc_net(struct rio_mport *mport)
112{ 112{
113 struct rio_net *net; 113 struct rio_net *net = kzalloc(sizeof(*net), GFP_KERNEL);
114 114
115 net = kzalloc(sizeof(struct rio_net), GFP_KERNEL);
116 if (net) { 115 if (net) {
117 INIT_LIST_HEAD(&net->node); 116 INIT_LIST_HEAD(&net->node);
118 INIT_LIST_HEAD(&net->devices); 117 INIT_LIST_HEAD(&net->devices);
@@ -246,8 +245,7 @@ int rio_request_inb_mbox(struct rio_mport *mport,
246 if (!mport->ops->open_inb_mbox) 245 if (!mport->ops->open_inb_mbox)
247 goto out; 246 goto out;
248 247
249 res = kzalloc(sizeof(struct resource), GFP_KERNEL); 248 res = kzalloc(sizeof(*res), GFP_KERNEL);
250
251 if (res) { 249 if (res) {
252 rio_init_mbox_res(res, mbox, mbox); 250 rio_init_mbox_res(res, mbox, mbox);
253 251
@@ -329,8 +327,7 @@ int rio_request_outb_mbox(struct rio_mport *mport,
329 if (!mport->ops->open_outb_mbox) 327 if (!mport->ops->open_outb_mbox)
330 goto out; 328 goto out;
331 329
332 res = kzalloc(sizeof(struct resource), GFP_KERNEL); 330 res = kzalloc(sizeof(*res), GFP_KERNEL);
333
334 if (res) { 331 if (res) {
335 rio_init_mbox_res(res, mbox, mbox); 332 rio_init_mbox_res(res, mbox, mbox);
336 333
@@ -445,8 +442,7 @@ int rio_request_inb_dbell(struct rio_mport *mport,
445 u16 dst, u16 info)) 442 u16 dst, u16 info))
446{ 443{
447 int rc = 0; 444 int rc = 0;
448 445 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
449 struct resource *res = kzalloc(sizeof(struct resource), GFP_KERNEL);
450 446
451 if (res) { 447 if (res) {
452 rio_init_dbell_res(res, start, end); 448 rio_init_dbell_res(res, start, end);
@@ -568,9 +564,8 @@ int rio_add_mport_pw_handler(struct rio_mport *mport, void *context,
568 void *context, union rio_pw_msg *msg, int step)) 564 void *context, union rio_pw_msg *msg, int step))
569{ 565{
570 int rc = 0; 566 int rc = 0;
571 struct rio_pwrite *pwrite; 567 struct rio_pwrite *pwrite = kzalloc(sizeof(*pwrite), GFP_KERNEL);
572 568
573 pwrite = kzalloc(sizeof(struct rio_pwrite), GFP_KERNEL);
574 if (!pwrite) { 569 if (!pwrite) {
575 rc = -ENOMEM; 570 rc = -ENOMEM;
576 goto out; 571 goto out;