All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shailendra Tripathi <stripathi@agami.com>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com,
	xfs-masters@oss.sgi.com, nathans@sgi.com,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH][RFC][resend] potential NULL pointer deref in XFS on failed mount
Date: Thu, 16 Nov 2006 13:44:05 -0800	[thread overview]
Message-ID: <455CDBA5.5070809@agami.com> (raw)
In-Reply-To: <9a8748490611161343x44e759acs9b70247c84452ba5@mail.gmail.com>

Jesper Juhl wrote:

> The reason I want to fix it in the freeing function is that many other
> functions in the kernel that free resources are safe to call with NULL
> pointers and this would make xfs_free_buftarg() follow that
> convention.  This would perhaps also allow for some cleanups in other
> places that call the function since then there's no longer a need for
> explicit NULL checks any more (haven't checked if there's anything to
> gain there though).
> I don't think the function call overhead matters much since this is in
> a case of a failed mount, so it should happen very rarely.
>
I agree with you.  However, cleanup functions should(/must?) check for  
NULL etc and
in this case it is already doing so for other cases. So, perhaps not 
required. Just a different viewpoint.
Your choice.

>> void
>> xfs_unmountfs_close(xfs_mount_t *mp, struct cred *cr)
>> {
>>        if (mp->m_logdev_targp && (mp->m_logdev_targp != 
>> mp->m_ddev_targp))
>>                 xfs_free_buftarg(mp->m_logdev_targp, 1);
>>         if (mp->m_rtdev_targp)
>>                 xfs_free_buftarg(mp->m_rtdev_targp, 1);
>>         xfs_free_buftarg(mp->m_ddev_targp, 0);
>> }
>>
>
>

  reply	other threads:[~2006-11-16 22:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16 21:18 [PATCH][RFC][resend] potential NULL pointer deref in XFS on failed mount Jesper Juhl
2006-11-16 21:23 ` Shailendra Tripathi
2006-11-16 21:43   ` Jesper Juhl
2006-11-16 21:44     ` Shailendra Tripathi [this message]
2006-11-16 22:09 ` David Chinner
2006-11-16 22:18   ` Jesper Juhl
2006-11-20 14:32     ` Jesper Juhl

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=455CDBA5.5070809@agami.com \
    --to=stripathi@agami.com \
    --cc=akpm@osdl.org \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathans@sgi.com \
    --cc=xfs-masters@oss.sgi.com \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.