Skip to content
Snippets Groups Projects
Commit 1194fb25 authored by Asias He's avatar Asias He Committed by Pekka Enberg
Browse files

ramdisk: Use dev->size instead of sc->size

parent cc8bf695
No related branches found
No related tags found
No related merge requests found
......@@ -57,9 +57,7 @@ static pthread_t ramdisk_thread;
static int
ramdisk_read(struct device *dev, struct uio *uio, int ioflags)
{
struct ramdisk_softc *sc = dev->private_data;
if (uio->uio_offset + uio->uio_resid > sc->size)
if (uio->uio_offset + uio->uio_resid > dev->size)
return EIO;
return bdev_read(dev, uio, ioflags);
......@@ -68,9 +66,7 @@ ramdisk_read(struct device *dev, struct uio *uio, int ioflags)
static int
ramdisk_write(struct device *dev, struct uio *uio, int ioflags)
{
struct ramdisk_softc *sc = dev->private_data;
if (uio->uio_offset + uio->uio_resid > sc->size)
if (uio->uio_offset + uio->uio_resid > dev->size)
return EIO;
return bdev_write(dev, uio, ioflags);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment