From: Dan Carpenter <dan.carpenter@oracle.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: target-devel@vger.kernel.org, David Disseldorp <ddiss@suse.de>,
kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
linux-scsi@vger.kernel.org
Subject: Re: [0/8] target-iSCSI: Adjustments for several function implementations
Date: Fri, 23 Feb 2018 13:17:15 +0300 [thread overview]
Message-ID: <20180223101715.xv5dscdaeszqxoyk@mwanda> (raw)
In-Reply-To: <145b88b1-bd1e-a417-8dce-ff19e35a00fc@users.sourceforge.net>
On Fri, Feb 23, 2018 at 10:06:16AM +0100, SF Markus Elfring wrote:
> > Calling crypto_free_shash(NULL) is actually fine.
>
> Really?
>
>
> > It doesn't dereference the parameter, it just does pointer math on it in
> > crypto_shash_tfm() and returns if it's NULL in crypto_destroy_tfm().
>
> Can a passed null pointer really work in this function?
>
> https://elixir.bootlin.com/linux/v4.16-rc2/source/include/crypto/hash.h#L684
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/crypto/hash.h?id=0f9da844d87796ac31b04e81ee95e155e9043132#n751
>
> static inline struct crypto_tfm *crypto_shash_tfm(struct crypto_shash *tfm)
> {
> return &tfm->base;
> }
Yes. It's not a dereference, it's just doing pointer math to get the
address.
regards,
dan carpenter
next prev parent reply other threads:[~2018-02-23 10:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 21:40 [PATCH 0/8] target-iSCSI: Adjustments for several function implementations SF Markus Elfring
2017-12-12 21:42 ` [PATCH 1/8] target/iscsi: Less function calls in chap_server_compute_md5() after error detection SF Markus Elfring
2017-12-12 21:43 ` [PATCH 2/8] target/iscsi: Move resetting of seven variables in chap_server_compute_md5() SF Markus Elfring
2017-12-12 21:45 ` [PATCH 3/8] target/iscsi: Delete 36 error messages for a failed memory allocation SF Markus Elfring
2017-12-12 21:46 ` [PATCH 4/8] target/iscsi: Delete an unnecessary variable initialisation in iscsit_allocate_ooo_cmdsn() SF Markus Elfring
2017-12-12 21:47 ` [PATCH 5/8] target/iscsi: Delete an unnecessary variable initialisation in iscsi_copy_param_list() SF Markus Elfring
2017-12-12 21:49 ` [PATCH 6/8] target/iscsi: Delete an unnecessary variable initialisation in iscsi_create_default_params() SF Markus Elfring
2017-12-12 21:50 ` [PATCH 7/8] target/iscsi: Delete an unnecessary variable initialisation in iscsi_set_default_param() SF Markus Elfring
2017-12-12 21:52 ` [PATCH 8/8] target/iscsi: Improve 16 size determinations SF Markus Elfring
2018-02-21 16:45 ` [PATCH 0/8] target-iSCSI: Adjustments for several function implementations SF Markus Elfring
[not found] ` <20180222143624.7c7241a1@suse.de>
2018-02-23 8:19 ` [0/8] " SF Markus Elfring
[not found] ` <20180222135600.5vv7vzw7sa5metcb@mwanda>
2018-02-23 9:06 ` SF Markus Elfring
2018-02-23 10:17 ` Dan Carpenter [this message]
2018-02-23 11:50 ` SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180223101715.xv5dscdaeszqxoyk@mwanda \
--to=dan.carpenter@oracle.com \
--cc=ddiss@suse.de \
--cc=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).