Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889Ab0K1UJH (ORCPT ); Sun, 28 Nov 2010 15:09:07 -0500 Received: from mail-pv0-f174.google.com ([74.125.83.174]:53676 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982Ab0K1UJF (ORCPT ); Sun, 28 Nov 2010 15:09:05 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=nXrfBeTaHKQ+SZuvyn4Kup8VV399UbKUdKrtAcjgyAAD6JrDwly5ofLTcf0EDYhEwh qjDwtGTpPhn81UXidIYUbKi+PFIfIA7CdUr9JptCNoN+OinJTkFr01qO6Fqcf3pkOMfP ivUzCGKmHJf8MaYfx/zjfD7OVMlMUDd82ASVU= MIME-Version: 1.0 Date: Sun, 28 Nov 2010 21:09:03 +0100 Message-ID: Subject: proc: proc_self_follow_link() weirdness From: Vegard Nossum To: Al Viro Cc: LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1005 Lines: 31 Hi, I came across this code in fs/proc/base.c: static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) { struct pid_namespace *ns = dentry->d_sb->s_fs_info; pid_t tgid = task_tgid_nr_ns(current, ns); char *name = ERR_PTR(-ENOENT); if (tgid) { name = __getname(); if (!name) name = ERR_PTR(-ENOMEM); else sprintf(name, "%d", tgid); } nd_set_link(nd, name); return NULL; } This looks a bit weird to me; it seems that nd_set_link() will get called with name = ERR_PTR(-ENOMEM) if __getname() fails. Is this the intended behaviour? Shouldn't it return this ERR_PTR() instead? Vegard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/