From patchwork Tue May 4 12:31:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 3296 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Tue, 04 May 2010 12:31:28 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Tue, 04 May 2010 09:38:53 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O9HHb-0007qe-P5; Tue, 04 May 2010 12:31:27 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758232Ab0EDMbZ (ORCPT + 1 other); Tue, 4 May 2010 08:31:25 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:37253 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757684Ab0EDMbY (ORCPT ); Tue, 4 May 2010 08:31:24 -0400 Received: by fxm10 with SMTP id 10so3148818fxm.19 for ; Tue, 04 May 2010 05:31:22 -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=hm3FsiVWAi9cgRsSQyEOnYVZYSd4uSoCU7C3jfc7W1s=; b=QEG3ZLiSfW4vaIqQC9U71Po+cur2clV5mRgzQXd2xEkdxMd0tHu+xzYAnlzqlbtFHR ooVJRTbilkjI4/bgDJdFqJJ56ZeuyBFRzK70Bdul5+2Xfe25ygGtqWW4TjEh3grcC/FB Sr/qodLDuMw9uhO/xk1Kv4K4j16kcPUuHlCrE= 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=uG4vdvcjnXtOE1yCiRUHfXEhnl1dziR+L4wF/Woek1sBjucUkhxAC+RFoEI+6zbdbc f+p2e3TA+ZrcDyKLEReFBwrVXcd+cRN9qzHIFXLatKKv4NnrwutsVUQH/VrStxf3oXgd pAb849xCJiykl37FDokIjH1O1pp52taPzVVGo= Received: by 10.223.46.135 with SMTP id j7mr4112335faf.105.1272976282022; Tue, 04 May 2010 05:31:22 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id 9sm11243894fks.56.2010.05.04.05.31.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 May 2010 05:31:21 -0700 (PDT) Date: Tue, 4 May 2010 14:31:13 +0200 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch -next 1/2] media/az6027: handle -EIO failure Message-ID: <20100504123113.GY29093@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If the az6027_usb_in_op() returns a negative errno ret is -EIO and in that case the value of b[0] may be undefined. The original code assigned 0 to ret, but since it's already 0 now we can skip that. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index baaa301..6681ac1 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c @@ -701,10 +701,7 @@ static int az6027_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int o } else ret = 0; - if (b[0] == 0) { - ret = 0; - - } else if (b[0] == 1) { + if (!ret && b[0] == 1) { ret = DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY; }