Skip to content

Commit 7cc2a8e

Browse files
committed
Merge tag 'block-5.8-2020-07-01' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: - Use kvfree_sensitive() for the block keyslot free (Eric) - Sync blk-mq debugfs flags (Hou) - Memory leak fix in virtio-blk error path (Hou) * tag 'block-5.8-2020-07-01' of git://git.kernel.dk/linux-block: virtio-blk: free vblk-vqs in error path of virtblk_probe() block/keyslot-manager: use kvfree_sensitive() blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags
2 parents c93493b + e7eea44 commit 7cc2a8e

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

block/blk-mq-debugfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ static const char *const blk_queue_flag_name[] = {
125125
QUEUE_FLAG_NAME(REGISTERED),
126126
QUEUE_FLAG_NAME(SCSI_PASSTHROUGH),
127127
QUEUE_FLAG_NAME(QUIESCED),
128+
QUEUE_FLAG_NAME(PCI_P2PDMA),
129+
QUEUE_FLAG_NAME(ZONE_RESETALL),
130+
QUEUE_FLAG_NAME(RQ_ALLOC_TIME),
128131
};
129132
#undef QUEUE_FLAG_NAME
130133

block/keyslot-manager.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,7 @@ void blk_ksm_destroy(struct blk_keyslot_manager *ksm)
374374
if (!ksm)
375375
return;
376376
kvfree(ksm->slot_hashtable);
377-
memzero_explicit(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
378-
kvfree(ksm->slots);
377+
kvfree_sensitive(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
379378
memzero_explicit(ksm, sizeof(*ksm));
380379
}
381380
EXPORT_SYMBOL_GPL(blk_ksm_destroy);

drivers/block/virtio_blk.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ static int virtblk_probe(struct virtio_device *vdev)
878878
put_disk(vblk->disk);
879879
out_free_vq:
880880
vdev->config->del_vqs(vdev);
881+
kfree(vblk->vqs);
881882
out_free_vblk:
882883
kfree(vblk);
883884
out_free_index:

include/linux/blkdev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ struct request_queue {
590590
u64 write_hints[BLK_MAX_WRITE_HINTS];
591591
};
592592

593+
/* Keep blk_queue_flag_name[] in sync with the definitions below */
593594
#define QUEUE_FLAG_STOPPED 0 /* queue is stopped */
594595
#define QUEUE_FLAG_DYING 1 /* queue being torn down */
595596
#define QUEUE_FLAG_NOMERGES 3 /* disable merge attempts */

0 commit comments

Comments
 (0)