Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp934205rwb; Wed, 28 Sep 2022 10:53:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6q6ujvCDo5bXU/fq/Zbexb23sRdi6lSWYlhzPdML2Hkc/XIAHa9gJhcqkKL10oz23oMpQK X-Received: by 2002:a17:903:246:b0:179:b6d0:f8fd with SMTP id j6-20020a170903024600b00179b6d0f8fdmr969365plh.124.1664387624994; Wed, 28 Sep 2022 10:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664387624; cv=none; d=google.com; s=arc-20160816; b=YbbzYm6Oz3cFnQUxfM6eZPJrXcB3kjuxche+nLM87AgorH2KDMDPfs3qSvizKv8tIR rq2FincI9vv/Vp0nAn02Q/Dm/1BrgCntakkpk8/j9QXy6wblQGbOJ4rVVECN0n6Mq1p2 2JBKFBIFKUCZdL+WYGxK3VsTHiYuI8f37HQHAWvgca1cCpt2auG1CocOmaKjYpOwOwEe tK2PmPRqxchHkbsH2IjFcyKeQLwHbO1N4ctKvOnR37SELflGqzAWy4o7pcO+0w0FrD6l wt3aBUFIOLr3CojGuwtSS8abpv+h8s4eL9UXt/+GcS1cBiKQ4T3zZ82/oYLXMMULV9Pr QWLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=l7u6sxjGd4Up3n2EXEn7w9kG6KJBfmCH4ZVKabih4Ew=; b=OOEVekEkKcdaXJik9UH/aym+RuEGO3JXCc9ILfR9cNFeNOPRpuVSVhKitAV3OigmYg wBrQWSm8BMwmqMT7zQo6+pMN+WftAHQgtKGFaKJBg/j4nENr9qMdlEs9hxjW6hs8Cmyy f410F9rciTnhBUKY6Sf/e4fiPvRWuFyTK4yswKqfAEG47pBC2GvPFF/c9xqmr8zkc5hH zsyHu3MpEcUtB0vkzWY2dzS71vUUs7tskqexyNjkO09RLM45ZUnUq4IwxclRRpT7n0iB rhcUux+jCBvLWdY0mD7ad1r1fv8FuC2CbVUpi+PpgSaa27/uxee0yehPhUBs4bHbzCDl 56bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C89c5692; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 139-20020a621591000000b0053e47fd7d0bsi2971359pfv.122.2022.09.28.10.53.33; Wed, 28 Sep 2022 10:53:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C89c5692; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234134AbiI1RXZ (ORCPT + 99 others); Wed, 28 Sep 2022 13:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233331AbiI1RXW (ORCPT ); Wed, 28 Sep 2022 13:23:22 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60FE87C1E8 for ; Wed, 28 Sep 2022 10:23:21 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id x92so5018327ede.9 for ; Wed, 28 Sep 2022 10:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=l7u6sxjGd4Up3n2EXEn7w9kG6KJBfmCH4ZVKabih4Ew=; b=C89c5692ohREy/7/FUOPApXHUtVSRPnO5sFmt3ft7MSAkvaKl76Vo2bgYkXdYgqtvP y2Dr2BSmjjxUCkYD451sEAnK0vxq5ysRpnih3PmadsdFcCTktMRRHwlFdCHraQbY0hWT apF12bmB3vS3T+/I9tp0DpjN16gEncbJhwGX/6fFqI4coOuFww24Cay0NyyxICEQZAYw sIyJqx0ln5Zr1HPGU4hP1WbtOIUaimLpefxv21zyYxS7vNDRFGvAi7ZsHTbXmEKpM0E3 SMDfNkrKPqAfKb9ad4u6cGKUoh2CgldA5KSjOFiiuyIkesxOnsYQDY/v5HxlHH4D3sFg 0vYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=l7u6sxjGd4Up3n2EXEn7w9kG6KJBfmCH4ZVKabih4Ew=; b=mC3vw82bEE/SdfOFwwRSiAWpuVPCbfu480qSsGvSnEBSX5u1PvrPbw0Krswod5paju PES06AqSSqzVYxktGrtJV0sxBx9FQsd0qYcEPG4C8GVLRgnKJXmykgFXAM1gB6RXVF0a F46sOXbUQpDcv8SdKqtSd7F15aGNh7eA9fVY65GQ+78Pia9MFuYxXjyvfU+JAQaw6BrT svZdIXw99ld5hmHDyr65XaDGybjpWLjP8FsxW4ZzC6QP/gr34NYfbaLUNU2vDRgfzpZh tpxL3GVBDXtXvCkrbnKBMXaqdynAejazN/IUqA2QrV+rebp7WpSJMeHX8HvfrtJl9G3Y SPMg== X-Gm-Message-State: ACrzQf0i0P0WDXxp97ZW7DpiUHLIECOtVRoT+bUWwbOTeBwY+u8/yx0M Qat7PHfDsafim0hKETBhKlV+9OAta+4= X-Received: by 2002:a05:6402:b0f:b0:458:1b:fc9a with SMTP id bm15-20020a0564020b0f00b00458001bfc9amr2183786edb.365.1664385799812; Wed, 28 Sep 2022 10:23:19 -0700 (PDT) Received: from localhost.localdomain (ip-217-105-46-158.ip.prioritytelecom.net. [217.105.46.158]) by smtp.gmail.com with ESMTPSA id lb6-20020a170907784600b007306a4ecc9dsm2725063ejc.18.2022.09.28.10.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 10:23:19 -0700 (PDT) From: Nam Cao To: forest@alittletooquiet.net, gregkh@linuxfoundation.org, dan.carpenter@oracle.com Cc: namcaov@gmail.com, philipp.g.hortmann@gmail.com, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [RFC PATCH v2 0/4] staging: vt6655: Implement allocation failure handling Date: Wed, 28 Sep 2022 19:21:46 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This driver does not handle allocation failure when receiving data very well. This patchset implements better handling in the case of allocation failure. Also do some necessary clean-up to implement this. v2: - squash 3 commits that were doing a single thing - add new commit which removes a redundant assignment - take device_init_rx_desc() out of unnecessary else condition. - remove return statement at the end of void function - add a missing rd = rd->next statement in device_rx_srv(): because we already drop the current buffer, we should move on to the next buffer in the ring where new data will be written to. Nam Cao (4): staging: vt6655: remove redundant if condition staging: vt6655: change vnt_receive_frame return type to void staging: vt6655: remove redundant assignment staging: vt6655: implement allocation failure handling drivers/staging/vt6655/device_main.c | 40 +++++++++++++++++----------- drivers/staging/vt6655/dpc.c | 8 +++--- drivers/staging/vt6655/dpc.h | 2 +- 3 files changed, 28 insertions(+), 22 deletions(-) -- 2.25.1