aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/fsl_rio.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-09-19 08:47:57 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-09-19 08:47:57 -0400
commit40d743b8c16a8cf6e30c1d941aa6147f9550ea75 (patch)
tree9fcdf9a06b18a275253048d1ea7c9803cec38845 /arch/powerpc/sysdev/fsl_rio.c
parent7da18afa423f167e7ef3c9728e584d8bf05bd55a (diff)
parent83e686ea0291ee93b87dcdc00b96443b80de56c9 (diff)
Merge branch 'for-rmk' of git://linux-arm.org/linux-2.6
Diffstat (limited to 'arch/powerpc/sysdev/fsl_rio.c')
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index cbb3bed75d3c..757a83fe5e59 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -1057,6 +1057,10 @@ int fsl_rio_setup(struct of_device *dev)
1057 law_start, law_size); 1057 law_start, law_size);
1058 1058
1059 ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL); 1059 ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
1060 if (!ops) {
1061 rc = -ENOMEM;
1062 goto err_ops;
1063 }
1060 ops->lcread = fsl_local_config_read; 1064 ops->lcread = fsl_local_config_read;
1061 ops->lcwrite = fsl_local_config_write; 1065 ops->lcwrite = fsl_local_config_write;
1062 ops->cread = fsl_rio_config_read; 1066 ops->cread = fsl_rio_config_read;
@@ -1064,6 +1068,10 @@ int fsl_rio_setup(struct of_device *dev)
1064 ops->dsend = fsl_rio_doorbell_send; 1068 ops->dsend = fsl_rio_doorbell_send;
1065 1069
1066 port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL); 1070 port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL);
1071 if (!port) {
1072 rc = -ENOMEM;
1073 goto err_port;
1074 }
1067 port->id = 0; 1075 port->id = 0;
1068 port->index = 0; 1076 port->index = 0;
1069 1077
@@ -1071,7 +1079,7 @@ int fsl_rio_setup(struct of_device *dev)
1071 if (!priv) { 1079 if (!priv) {
1072 printk(KERN_ERR "Can't alloc memory for 'priv'\n"); 1080 printk(KERN_ERR "Can't alloc memory for 'priv'\n");
1073 rc = -ENOMEM; 1081 rc = -ENOMEM;
1074 goto err; 1082 goto err_priv;
1075 } 1083 }
1076 1084
1077 INIT_LIST_HEAD(&port->dbells); 1085 INIT_LIST_HEAD(&port->dbells);
@@ -1169,11 +1177,13 @@ int fsl_rio_setup(struct of_device *dev)
1169 1177
1170 return 0; 1178 return 0;
1171err: 1179err:
1172 if (priv) 1180 iounmap(priv->regs_win);
1173 iounmap(priv->regs_win);
1174 kfree(ops);
1175 kfree(priv); 1181 kfree(priv);
1182err_priv:
1176 kfree(port); 1183 kfree(port);
1184err_port:
1185 kfree(ops);
1186err_ops:
1177 return rc; 1187 return rc;
1178} 1188}
1179 1189