Christophe JAILLET f281d010b8 ipmi: kcs_bmc: Fix a memory leak in the error handling path of 'kcs_bmc_serio_add_device()'
In the unlikely event where 'devm_kzalloc()' fails and 'kzalloc()'
succeeds, 'port' would be leaking.

Test each allocation separately to avoid the leak.

Fixes: 3a3d2f6a4c64 ("ipmi: kcs_bmc: Add serio adaptor")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <ecbfa15e94e64f4b878ecab1541ea46c74807670.1631048724.git.christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2021-10-29 07:23:59 -05:00
..
2020-09-15 09:57:45 -05:00
2019-08-02 07:25:03 -05:00
2019-08-02 07:25:03 -05:00
2021-10-14 11:17:18 -05:00
2020-09-15 09:57:45 -05:00
2020-09-15 09:57:45 -05:00
2021-06-21 19:50:28 -05:00