File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ static int gxp_timer_probe(struct platform_device *pdev)
171
171
{
172
172
struct platform_device * gxp_watchdog_device ;
173
173
struct device * dev = & pdev -> dev ;
174
+ int ret ;
174
175
175
176
if (!gxp_timer ) {
176
177
pr_err ("Gxp Timer not initialized, cannot create watchdog" );
@@ -187,7 +188,11 @@ static int gxp_timer_probe(struct platform_device *pdev)
187
188
gxp_watchdog_device -> dev .platform_data = gxp_timer -> counter ;
188
189
gxp_watchdog_device -> dev .parent = dev ;
189
190
190
- return platform_device_add (gxp_watchdog_device );
191
+ ret = platform_device_add (gxp_watchdog_device );
192
+ if (ret )
193
+ platform_device_put (gxp_watchdog_device );
194
+
195
+ return ret ;
191
196
}
192
197
193
198
static const struct of_device_id gxp_timer_of_match [] = {
You can’t perform that action at this time.
0 commit comments