Skip to content

Commit

Permalink
sd: Mark brittle abuse of blk_attach_dev() FIXME
Browse files Browse the repository at this point in the history
blk_attach_dev() fails here only when we're working for device
"sdhci-pci" (which already attached the backend), and then we don't
want to attach a second time.  If we ever create another failure mode,
we're setting up ourselves to using the same backend from multiple
frontends, which is likely to end in tears.  Can't clean this up this
close to the release, so mark it FIXME.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1449503710-3707-3-git-send-email-armbru@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
Markus Armbruster authored and pm215 committed Dec 7, 2015
1 parent 79f2170 commit ba306c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/sd/sd.c
Expand Up @@ -494,6 +494,7 @@ SDState *sd_init(BlockBackend *blk, bool is_spi)
if (sd->blk) {
/* Attach dev if not already attached. (This call ignores an
* error return code if sd->blk is already attached.) */
/* FIXME ignoring blk_attach_dev() failure is dangerously brittle */
blk_attach_dev(sd->blk, sd);
blk_set_dev_ops(sd->blk, &sd_block_ops, sd);
}
Expand Down

0 comments on commit ba306c7

Please sign in to comment.