Patchwork [04/19] qemu-char: qemu_chr_open_fd() can't fail, don't check

login
register
mail settings
Submitter Markus Armbruster
Date Feb. 7, 2012, 2:09 p.m.
Message ID <1328623766-12287-5-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/139936/
State New
Headers show

Comments

Markus Armbruster - Feb. 7, 2012, 2:09 p.m.
Cleaned up silently in commit aad04cd0, but that just got reverted.
Re-apply this part.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qemu-char.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
Anthony Liguori - Feb. 7, 2012, 3:24 p.m.
On 02/07/2012 08:09 AM, Markus Armbruster wrote:
> Cleaned up silently in commit aad04cd0, but that just got reverted.
> Re-apply this part.
>
> Signed-off-by: Markus Armbruster<armbru@redhat.com>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>   qemu-char.c |    4 ----
>   1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index c25863a..bb9e3f5 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -1226,10 +1226,6 @@ static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)
>       }
>       tty_serial_init(fd, 115200, 'N', 8, 1);
>       chr = qemu_chr_open_fd(fd, fd);
> -    if (!chr) {
> -        close(fd);
> -        return NULL;
> -    }
>       chr->chr_ioctl = tty_serial_ioctl;
>       chr->chr_close = qemu_chr_close_tty;
>       return chr;

Patch

diff --git a/qemu-char.c b/qemu-char.c
index c25863a..bb9e3f5 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1226,10 +1226,6 @@  static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)
     }
     tty_serial_init(fd, 115200, 'N', 8, 1);
     chr = qemu_chr_open_fd(fd, fd);
-    if (!chr) {
-        close(fd);
-        return NULL;
-    }
     chr->chr_ioctl = tty_serial_ioctl;
     chr->chr_close = qemu_chr_close_tty;
     return chr;