Merge tag 'alloc-args-v4.19-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Oct 2018 17:10:30 +0000 (19:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Oct 2018 17:10:30 +0000 (19:10 +0200)
Kees writes:
  "Fix open-coded multiplication arguments to allocators

   - Fixes several new open-coded multiplications added in the 4.19
     merge window."

* tag 'alloc-args-v4.19-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  treewide: Replace more open-coded allocation size multiplications

1  2 
drivers/md/dm-integrity.c

index 89ccb64342de7a4fa8e03d528f66ab9b726e0539,244ff5580f8241d6c74db6d3e56f869f57d7f3e2..e1fa6baf4e8e39ad79d39254c04be23333992f65
@@@ -532,7 -532,7 +532,7 @@@ static void section_mac(struct dm_integ
        unsigned j, size;
  
        desc->tfm = ic->journal_mac;
 -      desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
 +      desc->flags = 0;
  
        r = crypto_shash_init(desc);
        if (unlikely(r)) {
@@@ -676,7 -676,7 +676,7 @@@ static void complete_journal_encrypt(st
  static bool do_crypt(bool encrypt, struct skcipher_request *req, struct journal_completion *comp)
  {
        int r;
 -      skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
 +      skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
                                      complete_journal_encrypt, comp);
        if (likely(encrypt))
                r = crypto_skcipher_encrypt(req);
@@@ -3462,7 -3462,8 +3462,8 @@@ try_smaller_buffer
                        r = -ENOMEM;
                        goto bad;
                }
-               ic->recalc_tags = kvmalloc((RECALC_SECTORS >> ic->sb->log2_sectors_per_block) * ic->tag_size, GFP_KERNEL);
+               ic->recalc_tags = kvmalloc_array(RECALC_SECTORS >> ic->sb->log2_sectors_per_block,
+                                                ic->tag_size, GFP_KERNEL);
                if (!ic->recalc_tags) {
                        ti->error = "Cannot allocate tags for recalculating";
                        r = -ENOMEM;