From patchwork Mon Oct 11 19:14:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 246291 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9BJEiEo007708 for ; Mon, 11 Oct 2010 19:14:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755674Ab0JKTOn (ORCPT ); Mon, 11 Oct 2010 15:14:43 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:46175 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755315Ab0JKTOn (ORCPT ); Mon, 11 Oct 2010 15:14:43 -0400 Received: by wwj40 with SMTP id 40so4102455wwj.1 for ; Mon, 11 Oct 2010 12:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=6dB3ByOaYaL/SRBiF9VewDR9Tuy60/iG3noVXKQdlUU=; b=rfwyOmVWR+Z5GM+y8VcUBWLZ4VtezNFQRJ4vIAZ0+22jKZnZBVPMq2Ok8uoP8YG1lZ z13iAbNwbvn+nG7pIRapU5i/lWVX9PjReHrZwHQshljLNulDFLrvOMpbvvHYDnanLgIu ZXLZboJFC+Zr2A3NO32g515pkQB7+7lzs5xYI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=PHut6b2/YwftcpLhODtkoGc7uB1GV0v8AbZj9NdGe3OeDVynUEBFs0vB2MKjDaEjkR 9XhePI548pH0SdzeP4H43CKekxwjfO11GHdpF2HbmUwbY0l8RJX081PWxrlVKleuT15m x3y7OtYX9K8fNsigv+sxOdFZSWOhNRJ9v13kQ= Received: by 10.216.168.202 with SMTP id k52mr5694098wel.105.1286824481561; Mon, 11 Oct 2010 12:14:41 -0700 (PDT) Received: from bicker (h3f05.n1.ips.mtn.co.ug [41.210.191.5]) by mx.google.com with ESMTPS id x59sm1517051weq.38.2010.10.11.12.14.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 11 Oct 2010 12:14:33 -0700 (PDT) Date: Mon, 11 Oct 2010 21:14:23 +0200 From: Dan Carpenter To: Yehuda Sadeh Cc: Sage Weil , ceph-devel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 1/2 -next] rbd: null vs ERR_PTR Message-ID: <20101011191423.GI5851@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 11 Oct 2010 19:14:45 +0000 (UTC) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 1ac87f1..52f9420 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -826,8 +826,8 @@ static int rbd_req_sync_op(struct rbd_device *dev, num_pages = calc_pages_for(ofs , len); pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL); - if (!pages) - return -ENOMEM; + if (IS_ERR(pages)) + return PTR_ERR(pages); if (!orig_ops) { payload_len = (flags & CEPH_OSD_FLAG_WRITE ? len : 0);