File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,10 @@ static __init struct device *sysfb_parent_dev(const struct screen_info *si)
101
101
if (IS_ERR (pdev )) {
102
102
return ERR_CAST (pdev );
103
103
} else if (pdev ) {
104
- if (!sysfb_pci_dev_is_enabled (pdev ))
104
+ if (!sysfb_pci_dev_is_enabled (pdev )) {
105
+ pci_dev_put (pdev );
105
106
return ERR_PTR (- ENODEV );
107
+ }
106
108
return & pdev -> dev ;
107
109
}
108
110
@@ -137,7 +139,7 @@ static __init int sysfb_init(void)
137
139
if (compatible ) {
138
140
pd = sysfb_create_simplefb (si , & mode , parent );
139
141
if (!IS_ERR (pd ))
140
- goto unlock_mutex ;
142
+ goto put_device ;
141
143
}
142
144
143
145
/* if the FB is incompatible, create a legacy framebuffer device */
@@ -155,7 +157,7 @@ static __init int sysfb_init(void)
155
157
pd = platform_device_alloc (name , 0 );
156
158
if (!pd ) {
157
159
ret = - ENOMEM ;
158
- goto unlock_mutex ;
160
+ goto put_device ;
159
161
}
160
162
161
163
pd -> dev .parent = parent ;
@@ -170,9 +172,11 @@ static __init int sysfb_init(void)
170
172
if (ret )
171
173
goto err ;
172
174
173
- goto unlock_mutex ;
175
+ goto put_device ;
174
176
err :
175
177
platform_device_put (pd );
178
+ put_device :
179
+ put_device (parent );
176
180
unlock_mutex :
177
181
mutex_unlock (& disable_lock );
178
182
return ret ;
You can’t perform that action at this time.
0 commit comments