diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2021-06-09 20:27:39 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-06-09 09:41:55 -0600 |
commit | ec1e7e8853b62cb971828d66a1f298a280182831 (patch) | |
tree | 5cfb9417b4fcc0e21d6f91cb766c899a63ffe9d9 /drivers/block/z2ram.c | |
parent | c744b06254a3a163c6bcf70bb21f0241107271fc (diff) | |
download | lwn-ec1e7e8853b62cb971828d66a1f298a280182831.tar.gz lwn-ec1e7e8853b62cb971828d66a1f298a280182831.zip |
z2ram: remove unnecessary oom message
Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message
Remove it can help us save a bit of memory.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/z2ram.c')
-rw-r--r-- | drivers/block/z2ram.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index c1d20818e649..dce119f697a7 100644 --- a/drivers/block/z2ram.c +++ b/drivers/block/z2ram.c @@ -236,11 +236,8 @@ static int z2_open(struct block_device *bdev, fmode_t mode) case Z2MINOR_Z2ONLY: z2ram_map = kmalloc(max_z2_map, GFP_KERNEL); - if (z2ram_map == NULL) { - printk(KERN_ERR DEVICE_NAME - ": cannot get mem for z2ram_map\n"); + if (!z2ram_map) goto err_out; - } get_z2ram(); @@ -253,11 +250,8 @@ static int z2_open(struct block_device *bdev, fmode_t mode) case Z2MINOR_CHIPONLY: z2ram_map = kmalloc(max_chip_map, GFP_KERNEL); - if (z2ram_map == NULL) { - printk(KERN_ERR DEVICE_NAME - ": cannot get mem for z2ram_map\n"); + if (!z2ram_map) goto err_out; - } get_chipram(); |