[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [Bug 1240669] Re: sd_init() generates SIGSEGV when passed N

From: T. Huth
Subject: [Qemu-devel] [Bug 1240669] Re: sd_init() generates SIGSEGV when passed NULL
Date: Tue, 28 Jun 2016 14:43:46 -0000

** Changed in: qemu
       Status: Fix Committed => Fix Released

You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

  sd_init() generates SIGSEGV when passed NULL

Status in QEMU:
  Fix Released

Bug description:
  Ran into a bug following the following tutorial:

  I built QEMU from a clone of master and became stuck at the beginning
  part of the tutorial where only u-boot.bin is exectuted.

  See the modifications to sd.c specifically.

  When sd_init (sd.c) is called from pl181_init(), bs is potentially null:
  s->card = sd_init(dinfo ? dinfo->bdrv : NULL, false);


  SDState *sd_init(BlockDriverState *bs, bool is_spi) 
      SDState *sd; 
      if (bdrv_is_read_only(bs)) { 
          fprintf(stderr, "sd_init: Cannot use read-only drive\n"); 
          return NULL; 
      sd = (SDState *) g_malloc0(sizeof(SDState)); 
      sd->buf = qemu_blockalign(bs, 512); 
      sd->spi = is_spi; 
      sd->enable = true; 
      sd_reset(sd, bs); 
      if (sd->bdrv) { 
          bdrv_attach_dev_nofail(sd->bdrv, sd); 
          bdrv_set_dev_ops(sd->bdrv, &sd_block_ops, sd); 
      vmstate_register(NULL, -1, &sd_vmstate, sd); 
      return sd; 

  Line 497 calls bdrv_is_read_only(bs) (from block.c)and this generates a 

  int bdrv_is_read_only(BlockDriverState *bs)
      return bs->read_only;

  Checking out tag v1.6.1 reverted the problem.  Thanks!

To manage notifications about this bug go to:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]