Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp541240imu; Thu, 20 Dec 2018 00:59:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/XUm9/9nV7QyWDbBSXujeu8WGyywgHLt+7uAaW2TllpqdbYk31NX5YUzyQDbCisb3FYSbkO X-Received: by 2002:a65:610d:: with SMTP id z13mr22542923pgu.427.1545296376566; Thu, 20 Dec 2018 00:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545296376; cv=none; d=google.com; s=arc-20160816; b=vkvDTJT6zNtEtn7w/C/yAbkZcaKq0SE/NBd+Bv80ttXzNVNPruFPWD85lTebXUjocV toCM59dECeeiv3/JxVuELsODskzwF+D4mzs7t+oaXyGXy/QjthlJ9v0Vv1Nb6GbC9Gxm Zjab8XSemV342ZeRW+jADImrgwljgLfSGFKCX2l50bubrnDGprXS3650K/ixYOc3eVAh kfwyn7upHts69cA9OVkX7TZwzZ0ma5+0tyw3+ieyrvTevSnSiluONz8exZcmvKgZ7zrA f2gBAdlOD/egDCvM007AFqVNPCW+fFD4jAyX9peQunYKE/63OjxahZ7TZeRHUyKH+a5T OD1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=KMYQEMyyybUcQQyBJoB5ewVLk/EnSbZoz+SUWx1zAAQ=; b=EkEXK3o278+SdAsQCH6S9gFpjv1MNaO0DpE6PRxTca3Dm8FYDNz3YUvfgYjko0Efy/ ry47ZcBsu8NTHHH9ntUKpt8+PECJMJrxo02S6lL2VrZDDjQ1NKcY++vAkWemveWZA6iL TWuGcRqWgv6SbMMzigC+GQhN129IGzzROqKw+lsS7aFE0rqrfuCcdmAxVCVPwylo6cyP NCPFXIVk0kITVumRJLmV5DPRqBmgzXAEzdOXRUi83j2QC3jKY6HQVdquZhkcfOdGNMdG 0uhkkuIX5OH1XUgTL/oLXt/FEq+e2aPT7ua+zFBTFZLe+6pC8jntYOhM6u1c1UyaY1I1 xhTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b=C6OGDMqb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si17506485plv.413.2018.12.20.00.59.20; Thu, 20 Dec 2018 00:59:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b=C6OGDMqb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730158AbeLTG6O (ORCPT + 99 others); Thu, 20 Dec 2018 01:58:14 -0500 Received: from mta-p8.oit.umn.edu ([134.84.196.208]:51618 "EHLO mta-p8.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727976AbeLTG6O (ORCPT ); Thu, 20 Dec 2018 01:58:14 -0500 Received: from localhost (unknown [127.0.0.1]) by mta-p8.oit.umn.edu (Postfix) with ESMTP id 4D976C92 for ; Thu, 20 Dec 2018 06:58:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p8.oit.umn.edu ([127.0.0.1]) by localhost (mta-p8.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CPbt_DYCoOSn for ; Thu, 20 Dec 2018 00:58:12 -0600 (CST) Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p8.oit.umn.edu (Postfix) with ESMTPS id 23BBEC91 for ; Thu, 20 Dec 2018 00:58:12 -0600 (CST) Received: by mail-io1-f71.google.com with SMTP id f2so722507ioq.22 for ; Wed, 19 Dec 2018 22:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id; bh=KMYQEMyyybUcQQyBJoB5ewVLk/EnSbZoz+SUWx1zAAQ=; b=C6OGDMqbJOiddAkIhfXdDAtudXouRc7ncV0itJNexjnUu6FAbi+XtR4T3FWSd53csG t2UC6H0gU5Q/ixH1auCZbTx3CFqqTG3O3q7wYhZZ+YgeB+BGuDxdYl4zvyBmGUzt+qBG prUvX2BF4yldU3BhUHfSXGUlSr63qKfrAEP7boZ+s3n6OA3BgfRg4P4Et8uUCrpBswqG meuetEy4cQHqCrICGXjX3qAmDZW+BJOh/sn+rbe+3y+quJnwgJXZdx/L8x8oTCRhOgyX bG2BN6115YQr2L5DC5UoQ6dL1aOp83Zz5nbxNNg6n1k5YMfERPadmxWbYqECYlnO4KXr dGhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KMYQEMyyybUcQQyBJoB5ewVLk/EnSbZoz+SUWx1zAAQ=; b=PyzHXh6696LFB+hNmCPZdZEu9pM7ZCCDNA7ZsBlmEYTEI3cWndNeiXVp4yqhTneo7+ 16F8QbrIOgHzyhG5PgMb06ePSvXqgK5m/OOcZ5HHMqxI57TFFgHjkPaFimiBw5zTxd/m DJyzZUZpf0DcLnUi1hFs1hDAWfP28/s4fvVInSagn8/uwA6t7XzN6OST1VXpNYUcLTUF uT2DgBGSHhxUo1vLdFcxplhFaY9AG/VOFznU0VgKgO7O2zPp9UjIiPh52SQ40BgufBdg 0HdFJDP47F+V/vNJPFpypghNIXs6BVBp9r98VpI+Myy4LYOYjIUvyUEUce4yJvcDbkV4 bKCg== X-Gm-Message-State: AA+aEWb9Awf8Ix/AkXurL0v8LiU+qT2CnxLK04EIV15BBbprNMiwonzV A2JmHMsYhPijlimZqvh4r0UIRP9H57RAeuPQj9OilYed3R7qo0YML2KBq0+7w4CaIN6XzXLieHJ U67ipON7oiZTMVfpKnjyXB2qeeYLP X-Received: by 2002:a05:660c:914:: with SMTP id s20mr9015066itj.160.1545289091608; Wed, 19 Dec 2018 22:58:11 -0800 (PST) X-Received: by 2002:a05:660c:914:: with SMTP id s20mr9015055itj.160.1545289091304; Wed, 19 Dec 2018 22:58:11 -0800 (PST) Received: from localhost.localdomain (host-173-230-104-24.mnmigsc.mn.minneapolis.us.clients.pavlovmedia.net. [173.230.104.24]) by smtp.gmail.com with ESMTPSA id m37sm4558529iti.6.2018.12.19.22.58.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Dec 2018 22:58:10 -0800 (PST) From: Kangjie Lu To: kjlu@umn.edu Cc: pakki001@umn.edu, Mauro Carvalho Chehab , "Gustavo A. R. Silva" , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: drx: fix a missing check of return value Date: Thu, 20 Dec 2018 00:57:44 -0600 Message-Id: <20181220065747.40379-1-kjlu@umn.edu> X-Mailer: git-send-email 2.17.2 (Apple Git-113) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function drxj_dap_write_reg16(), which writes data to buffer, may fail. We need to check if it fails, and if so, we should goto error. Otherwise, the buffer will have incorrect data. Signed-off-by: Kangjie Lu --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 551b7d65fa66..d105125bc1c3 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -2136,9 +2136,13 @@ int drxj_dap_atomic_read_write_block(struct i2c_device_addr *dev_addr, word = ((u16) data[2 * i]); word += (((u16) data[(2 * i) + 1]) << 8); - drxj_dap_write_reg16(dev_addr, + rc = drxj_dap_write_reg16(dev_addr, (DRXJ_HI_ATOMIC_BUF_START + i), word, 0); + if (rc) { + pr_err("error %d\n", rc); + goto rw_error; + } } } -- 2.17.2 (Apple Git-113)