mbox

[PULL,for-2.1] virtio-rng: Fix abort on invalid input

Message ID 20140716091327.GD22288@grmbl.mre
State New
Headers show

Pull-request

git://git.kernel.org/pub/scm/virt/qemu/amit/virtio-rng.git for-2.1

Message

Amit Shah July 16, 2014, 9:13 a.m. UTC
Hi,

This patch returns an error instead of aborting, which is desirable
not just for cmdline invocation, but prevents an abort in case of
device hotplug.

Patch is small, and reviewed on-list.

Please pull,

The following changes since commit 5a7348045091a2bc15d85bb177e5956aa6114e5a:

  Update version for v2.1.0-rc2 release (2014-07-15 18:55:37 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/qemu/amit/virtio-rng.git for-2.1

for you to fetch changes up to 9ef6be93250e46d35062c84d5c75c7cb515dc27c:

  virtio-rng: Add human-readable error message for negative max-bytes parameter (2014-07-16 14:25:29 +0530)

----------------------------------------------------------------
John Snow (1):
      virtio-rng: Add human-readable error message for negative max-bytes parameter

 hw/virtio/virtio-rng.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

		Amit

Comments

Peter Maydell July 17, 2014, 12:49 p.m. UTC | #1
On 16 July 2014 10:13, Amit Shah <amit.shah@redhat.com> wrote:
> Hi,
>
> This patch returns an error instead of aborting, which is desirable
> not just for cmdline invocation, but prevents an abort in case of
> device hotplug.
>
> Patch is small, and reviewed on-list.
>
> Please pull,
>
> The following changes since commit 5a7348045091a2bc15d85bb177e5956aa6114e5a:
>
>   Update version for v2.1.0-rc2 release (2014-07-15 18:55:37 +0100)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/virt/qemu/amit/virtio-rng.git for-2.1
>
> for you to fetch changes up to 9ef6be93250e46d35062c84d5c75c7cb515dc27c:
>
>   virtio-rng: Add human-readable error message for negative max-bytes parameter (2014-07-16 14:25:29 +0530)

Hi. I'm afraid this doesn't build on 32-bit hosts:

CC hw/virtio/virtio-rng.o
/root/qemu/hw/virtio/virtio-rng.c: In function 'virtio_rng_device_realize':
/root/qemu/hw/virtio/virtio-rng.c:186:19: error: format '%lld' expects
argument of type 'long long int', but argument 7 has type 'long int'
[-Werror=format]
cc1: all warnings being treated as errors

I think you want "(int64_t)0" rather than "0L".

thanks
-- PMM