mxser: alloc only needed # of ports
authorJiri Slaby <jslaby@suse.cz>
Fri, 18 Jun 2021 06:14:59 +0000 (08:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jun 2021 11:10:02 +0000 (13:10 +0200)
commitad1c92ff6ee948584603ef2e004704cfceb899a4
tree52b94329f8ac33f0b3b0b61aa58e5e0494f7a3d5
parentf8b6b327aa73dd69577abd4e164447a9cc124315
mxser: alloc only needed # of ports

Many boards have only 2 ports. But we always allocate 8 ports (struct
mxser_port) in each struct mxser_board.

Switch this to an empty/variable sized array ([]) and allocate the
needed number of ports using struct_size helper in ->probe.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210618061516.662-54-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/mxser.c