qemu-e2k/hw/mem
Igor Mammedov 22235bb609 pc-dimm: fix crash when invalid slot number is used
QEMU will crash with:
  Segmentation fault (core dumped)
when negative slot number is used, ex:
  qemu-system-x86_64 -m 1G,maxmem=20G,slots=256 \
      -object memory-backend-ram,id=mem1,size=1G \
      -device pc-dimm,id=dimm1,memdev=mem1,slot=-2

fix it by checking that slot number is within valid range.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20190723160859.27250-1-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Igor Mammedov &lt;<a href="mailto:imammedo@redhat.com" target="_blank">imammedo@redhat.com</a>&gt;<br></blockquote><div><br></div><div>Reviewed-by: Li Qiang &lt;<a href="mailto:liq3ea@gmail.com">liq3ea@gmail.com</a>&gt;<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Reviewed-by: Pankaj Gupta <pagupta@redhat.com>
2019-07-29 16:57:27 -04:00
..
Kconfig ppc64: Express dependencies of 'pseries' and 'powernv' machines with kconfig 2019-03-07 21:45:53 +01:00
Makefile.objs memory-device: introduce separate config option 2018-10-24 06:44:59 -03:00
memory-device.c memory-device: rewrite address assignment using ranges 2019-01-09 22:09:31 -02:00
nvdimm.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
pc-dimm.c pc-dimm: fix crash when invalid slot number is used 2019-07-29 16:57:27 -04:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00