serial: avoid double free after call ioc4_serial_remove_one

before goto out5,  soft, control, serial are all assigned to idd
  after finish call ioc4_serial_remove_one, all resources are released
  we need return instead of go on, or double free

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Chen Gang 2012-12-26 18:06:39 +08:00 committed by Greg Kroah-Hartman
parent f96f7f7f39
commit 6d8df4b6a3
1 changed files with 1 additions and 0 deletions

View File

@ -2883,6 +2883,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
/* error exits that give back resources */
out5:
ioc4_serial_remove_one(idd);
return ret;
out4:
kfree(soft);
out3: