qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Pisa <pisa@cmp.felk.cvut.cz>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Vikram Garhwal" <fnu.vikram@xilinx.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	qemu-devel@nongnu.org,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH 2/3] can-host-socketcan: Fix crash when 'if' option is not set
Date: Fri, 9 Oct 2020 00:18:24 +0200	[thread overview]
Message-ID: <202010090018.24802.pisa@cmp.felk.cvut.cz> (raw)
In-Reply-To: <20201008202713.1416823-3-ehabkost@redhat.com>

Thanks for catching missing test

On Thursday 08 of October 2020 22:27:12 Eduardo Habkost wrote:
> Fix the following crash:
>
>   $ qemu-system-x86_64 -object can-host-socketcan,id=obj0
>   Segmentation fault (core dumped)
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: Pavel Pisa <pisa@cmp.felk.cvut.cz>
> Cc: Vikram Garhwal <fnu.vikram@xilinx.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  net/can/can_socketcan.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/net/can/can_socketcan.c b/net/can/can_socketcan.c
> index 92b1f79385..4b68f60c6b 100644
> --- a/net/can/can_socketcan.c
> +++ b/net/can/can_socketcan.c
> @@ -194,6 +194,11 @@ static void can_host_socketcan_connect(CanHostState
> *ch, Error **errp) struct sockaddr_can addr;
>      struct ifreq ifr;
>
> +    if (!c->ifname) {
> +        error_setg(errp, "'if' property not set");
> +        return;
> +    }
> +
>      /* open socket */
>      s = qemu_socket(PF_CAN, SOCK_RAW, CAN_RAW);
>      if (s < 0) {

Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>

-- 
                Pavel Pisa
    e-mail:     pisa@cmp.felk.cvut.cz
    Department of Control Engineering FEE CVUT
    Karlovo namesti 13, 121 35, Prague 2
    university: http://dce.fel.cvut.cz/
    personal:   http://cmp.felk.cvut.cz/~pisa
    projects:   https://www.openhub.net/accounts/ppisa
    CAN related:http://canbus.pages.fel.cvut.cz/



  reply	other threads:[~2020-10-08 22:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 20:27 [PATCH 0/3] Fix some crashes when using -object Eduardo Habkost
2020-10-08 20:27 ` [PATCH 1/3] authz-list-file: Fix crash when filename is not set Eduardo Habkost
2020-10-08 21:17   ` Cleber Rosa
2020-10-09  8:37   ` Daniel P. Berrangé
2020-10-09 10:31   ` Philippe Mathieu-Daudé
2020-10-09 15:06   ` Li Qiang
2020-10-08 20:27 ` [PATCH 2/3] can-host-socketcan: Fix crash when 'if' option " Eduardo Habkost
2020-10-08 22:18   ` Pavel Pisa [this message]
2020-10-09 15:17   ` Li Qiang
2020-10-12 16:23   ` Vikram Garhwal
2020-10-08 20:27 ` [PATCH 3/3] tests/acceptance: Test case for detecting -object crashes Eduardo Habkost
2020-10-09  0:48   ` Cleber Rosa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202010090018.24802.pisa@cmp.felk.cvut.cz \
    --to=pisa@cmp.felk.cvut.cz \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=fnu.vikram@xilinx.com \
    --cc=jasowang@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).