From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753214AbbJOUxF (ORCPT ); Thu, 15 Oct 2015 16:53:05 -0400 Received: from rcdn-iport-5.cisco.com ([173.37.86.76]:50885 "EHLO rcdn-iport-5.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751997AbbJOUwf (ORCPT ); Thu, 15 Oct 2015 16:52:35 -0400 X-IronPort-AV: E=Sophos;i="5.17,687,1437436800"; d="scan'208";a="38009283" Date: Thu, 15 Oct 2015 15:52:32 -0500 From: Dave Goodell To: Insu Yun Cc: "umalhi@cisco.com" , "dledford@redhat.com" , "sean.hefty@intel.com" , "hal.rosenstock@gmail.com" , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "taesoo@gatech.edu" , "yeongjin.jang@gatech.edu" , "insu@gatech.edu" Subject: Re: [PATCH] usnic: corretly check failed allocation Message-ID: <20151015205232.GA70439@DGOODELL-M-F02A.cisco.com> References: <1444926460-29333-1-git-send-email-wuninsu@gmail.com> <1D90F355-D799-4E9E-9526-836B71355109@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated-User: dgoodell Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 15, 2015 at 01:41:06PM -0400, Insu Yun wrote: > On Thu, Oct 15, 2015 at 1:17 PM, Dave Goodell (dgoodell) > wrote: > > > On Oct 15, 2015, at 11:27 AM, Insu Yun wrote: > > > > > > us_ibdev->ufdev = usnic_fwd_dev_alloc(dev); > > > - if (IS_ERR_OR_NULL(us_ibdev->ufdev)) { > > > + if (!us_ibdev->ufdev) { > > > usnic_err("Failed to alloc ufdev for %s with err %ld\n", > > > pci_name(dev), PTR_ERR(us_ibdev->ufdev)); > > > > This PTR_ERR and message make less sense now. > > > > Do you think what is better? removing error code? or change > PTR_ERR(us_ibdev->ufdev) > to -EFAULT I would write it as: usnic_err("Failed to alloc ufdev for %s\n", pci_name(dev)); -Dave