@@ -1281,14 +1281,13 @@ static void submit_one_flush(struct drbd_device *device, struct issue_flush_cont
1281
1281
{
1282
1282
struct bio * bio = bio_alloc (GFP_NOIO , 0 );
1283
1283
struct one_flush_context * octx = kmalloc (sizeof (* octx ), GFP_NOIO );
1284
- if (!bio || !octx ) {
1285
- drbd_warn (device , "Could not allocate a bio, CANNOT ISSUE FLUSH\n" );
1284
+
1285
+ if (!octx ) {
1286
+ drbd_warn (device , "Could not allocate a octx, CANNOT ISSUE FLUSH\n" );
1286
1287
/* FIXME: what else can I do now? disconnecting or detaching
1287
1288
* really does not help to improve the state of the world, either.
1288
1289
*/
1289
- kfree (octx );
1290
- if (bio )
1291
- bio_put (bio );
1290
+ bio_put (bio );
1292
1291
1293
1292
ctx -> error = - ENOMEM ;
1294
1293
put_ldev (device );
@@ -1646,7 +1645,6 @@ int drbd_submit_peer_request(struct drbd_device *device,
1646
1645
unsigned data_size = peer_req -> i .size ;
1647
1646
unsigned n_bios = 0 ;
1648
1647
unsigned nr_pages = (data_size + PAGE_SIZE - 1 ) >> PAGE_SHIFT ;
1649
- int err = - ENOMEM ;
1650
1648
1651
1649
/* TRIM/DISCARD: for now, always use the helper function
1652
1650
* blkdev_issue_zeroout(..., discard=true).
@@ -1688,10 +1686,6 @@ int drbd_submit_peer_request(struct drbd_device *device,
1688
1686
*/
1689
1687
next_bio :
1690
1688
bio = bio_alloc (GFP_NOIO , nr_pages );
1691
- if (!bio ) {
1692
- drbd_err (device , "submit_ee: Allocation of a bio failed (nr_pages=%u)\n" , nr_pages );
1693
- goto fail ;
1694
- }
1695
1689
/* > peer_req->i.sector, unless this is the first bio */
1696
1690
bio -> bi_iter .bi_sector = sector ;
1697
1691
bio_set_dev (bio , device -> ldev -> backing_bdev );
@@ -1726,14 +1720,6 @@ int drbd_submit_peer_request(struct drbd_device *device,
1726
1720
drbd_submit_bio_noacct (device , fault_type , bio );
1727
1721
} while (bios );
1728
1722
return 0 ;
1729
-
1730
- fail :
1731
- while (bios ) {
1732
- bio = bios ;
1733
- bios = bios -> bi_next ;
1734
- bio_put (bio );
1735
- }
1736
- return err ;
1737
1723
}
1738
1724
1739
1725
static void drbd_remove_epoch_entry_interval (struct drbd_device * device ,
0 commit comments